Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support new Fast-CDR v2.0.0 [19456] #3828

Merged
merged 41 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
f9a211c
Refs #18687. Fix define MEMBER_ID_INVALID
richiware Jun 13, 2023
8062a17
Refs #18687. Change API of TypeSupport
richiware Jul 4, 2023
9a4038a
Refs #18687. Move calculate_serialized_size out from types
richiware Jul 13, 2023
4e36579
Refs #18687. Move serialize/deserialize out from types
richiware Jul 17, 2023
dd6f1b0
Refs #18687. Update to new API
richiware Jul 19, 2023
afe6c5c
Refs #18687. Update .repos
richiware Jul 21, 2023
35bd47e
Refs #18687. Update .repos
richiware Jul 21, 2023
b0fb900
Refs #18687. Fix linkage on windows
richiware Jul 25, 2023
37f7180
Refs #18687. Fix linkage on windows
richiware Jul 25, 2023
34a7b7f
Refs #18687. Fix on windows
richiware Jul 25, 2023
903b7dc
Update .repos
richiware Jul 31, 2023
2c58d2f
Refs #18687. Regenerated idl files
richiware Aug 23, 2023
33adf90
Update .repos
richiware Aug 24, 2023
5964685
Refs #18687. Update after changes on CdrSizeCalculator API
richiware Aug 25, 2023
643ce30
Refs #18687. Regenerated idl files
richiware Sep 6, 2023
bd5e334
Refs #18687. Fix after rebase
richiware Sep 6, 2023
3e87c9b
Refs #18687. Fix tests.
richiware Sep 12, 2023
b100b64
Refs #18687. Fix compilation error
richiware Sep 12, 2023
deaa306
Refs #18687. Regenerated types and fix tests
richiware Sep 13, 2023
e2c3799
Refs #18687. Fix compilation statistics
richiware Sep 13, 2023
0f49c2e
Refs #18687. Recover TypeObject public api
richiware Sep 14, 2023
1e5ba35
Refs #18687. Increase is_plain api
richiware Sep 15, 2023
eb6ab86
Refs #18687. Regenerated code with fix in is_plain
richiware Sep 15, 2023
5c7fc27
Refs #18687. Apply suggesntions
richiware Sep 18, 2023
164197d
Refs #18687. Apply suggestion
richiware Sep 18, 2023
363a898
Refs #18687. Apply suggestion
richiware Sep 18, 2023
6a4537a
Refs #18687. Apply suggestion
richiware Sep 18, 2023
4a7233a
Refs #18687. Fix doxygen
richiware Sep 19, 2023
6f46ec3
Refs #18687. Apply suggestions.
richiware Sep 20, 2023
d8d15ad
Refs #18687. Apply suggestion.
richiware Sep 20, 2023
e420fe0
Refs #18687. Apply suggestion
richiware Sep 20, 2023
4115518
Refs #18687. Update versions.md
richiware Sep 20, 2023
096e950
Refs #18687. Apply suggestion
richiware Sep 20, 2023
be14760
Refs #18687. Update fastcdr submodule
richiware Sep 20, 2023
8f9ad9f
Refs #18687. Update all cmake_minimum_required
richiware Sep 20, 2023
39167ee
Refs #18687. Move CDRSerialization.hpp from dds to rtps
richiware Sep 20, 2023
23cb25a
Refs #18687. Apply suggestions
richiware Sep 21, 2023
7d0278c
Refs #18687. Fix warning on mac
richiware Sep 22, 2023
eb78332
Refs #18687. Remove Benchmark example
richiware Sep 25, 2023
042ac9a
Refs #18687. Trying compile VS2017
richiware Sep 26, 2023
9c76dcc
Refs #18687. Fix warnings after upgrade clang
richiware Sep 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/reusable-windows-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Get minimum supported version of CMake
uses: lukka/get-cmake@latest
with:
cmakeVersion: '3.16.3'
cmakeVersion: '3.22.6'

- name: Patch SDK for source indexing
run: |
Expand Down
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
###############################################################################
# CMake build rules for Fast DDS
###############################################################################
cmake_minimum_required(VERSION 3.16.3)
cmake_policy(VERSION 3.16.3...3.20.3)
cmake_minimum_required(VERSION 3.22)

# Set CMAKE_BUILD_TYPE to Release by default.
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
Expand Down Expand Up @@ -75,7 +74,8 @@ else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-psabi")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-undefined,error")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-builtins")
JLBuenoLopez marked this conversation as resolved.
Show resolved Hide resolved
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl")
endif()

if(EPROSIMA_BUILD)
Expand Down Expand Up @@ -232,7 +232,7 @@ if(NOT BUILD_SHARED_LIBS)
set(FASTDDS_STATIC ON)
endif()

eprosima_find_package(fastcdr REQUIRED)
eprosima_find_package(fastcdr 2.0 REQUIRED)
eprosima_find_thirdparty(Asio asio VERSION 1.10.8)
eprosima_find_thirdparty(TinyXML2 tinyxml2)

Expand Down Expand Up @@ -507,9 +507,9 @@ if(BUILD_DOCUMENTATION)

# As stated in CMake's documentation: https://cmake.org/cmake/help/latest/command/file.html#transfer
# STATUS will return a list with two elements: the numeric status and the message returned.
# A 0 numeric error means no error in the operation
# A 0 numeric error means no error in the operation
list(GET DOWNLOAD_STATUS 0 DOWNLOAD_RC)

if (DOWNLOAD_RC)
message(STATUS "Unable to download documentation for version ${PROJECT_VERSION}. Falling back to latest.")
file(DOWNLOAD "https://fast-dds.docs.eprosima.com/_/downloads/en/latest/htmlzip/" "./eprosima-fast-rtps.zip")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

cmake_minimum_required(VERSION 3.16.3)
cmake_minimum_required(VERSION 3.22)

project(AdvancedConfigurationExample VERSION 1 LANGUAGES CXX)

Expand Down
83 changes: 9 additions & 74 deletions examples/cpp/dds/AdvancedConfigurationExample/HelloWorld.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

/*!
* @file HelloWorld.cpp
* This source file contains the definition of the described types in the IDL file.
* This source file contains the implementation of the described types in the IDL file.
*
* This file was generated by the tool gen.
* This file was generated by the tool fastddsgen.
*/

#ifdef _WIN32
Expand All @@ -29,27 +29,20 @@ char dummy;
#include "HelloWorld.h"
#include <fastcdr/Cdr.h>


#include <fastcdr/exceptions/BadParamException.h>
using namespace eprosima::fastcdr::exception;

#include <utility>

#define HelloWorld_max_cdr_typesize 24ULL;
#define HelloWorld_max_key_cdr_typesize 0ULL;

HelloWorld::HelloWorld()
{
// unsigned long m_index
m_index = 0;
// char m_message
memset(&m_message, 0, (20) * 1);

}

HelloWorld::~HelloWorld()
{


}

HelloWorld::HelloWorld(
Expand All @@ -60,7 +53,7 @@ HelloWorld::HelloWorld(
}

HelloWorld::HelloWorld(
HelloWorld&& x) noexcept
HelloWorld&& x) noexcept
{
m_index = x.m_index;
m_message = std::move(x.m_message);
Expand Down Expand Up @@ -89,8 +82,8 @@ HelloWorld& HelloWorld::operator =(
bool HelloWorld::operator ==(
const HelloWorld& x) const
{

return (m_index == x.m_index && m_message == x.m_message);
return (m_index == x.m_index &&
m_message == x.m_message);
}

bool HelloWorld::operator !=(
Expand All @@ -99,49 +92,6 @@ bool HelloWorld::operator !=(
return !(*this == x);
}

size_t HelloWorld::getMaxCdrSerializedSize(
size_t current_alignment)
{
static_cast<void>(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;

}

/*!
* @brief This function sets a value in member index
* @param _index New value for member index
Expand Down Expand Up @@ -170,6 +120,7 @@ uint32_t& HelloWorld::index()
return m_index;
}


/*!
* @brief This function copies the value in member message
* @param _message New value to be copied in member message
Expand Down Expand Up @@ -209,21 +160,5 @@ std::array<char, 20>& HelloWorld::message()
}


size_t HelloWorld::getKeyMaxCdrSerializedSize(
size_t current_alignment)
{
static_cast<void>(current_alignment);
return HelloWorld_max_key_cdr_typesize;
}

bool HelloWorld::isKeyDefined()
{
return false;
}

void HelloWorld::serializeKey(
eprosima::fastcdr::Cdr& scdr) const
{
(void) scdr;
}

// Include auxiliary functions like for serializing/deserializing.
#include "HelloWorldCdrAux.ipp"
80 changes: 14 additions & 66 deletions examples/cpp/dds/AdvancedConfigurationExample/HelloWorld.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,23 @@
* @file HelloWorld.h
* This header file contains the declaration of the described types in the IDL file.
*
* This file was generated by the tool gen.
* This file was generated by the tool fastddsgen.
*/

#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_
#define _FAST_DDS_GENERATED_HELLOWORLD_H_


#include <fastrtps/utils/fixed_size_string.hpp>

#include <stdint.h>
#include <array>
#include <bitset>
#include <cstdint>
#include <map>
#include <string>
#include <vector>
#include <map>
#include <bitset>

#include <fastcdr/cdr/fixed_size_string.hpp>
#include <fastcdr/xcdr/optional.hpp>



#if defined(_WIN32)
#if defined(EPROSIMA_USER_DLL_EXPORT)
Expand Down Expand Up @@ -59,10 +61,12 @@
namespace eprosima {
namespace fastcdr {
class Cdr;
class CdrSizeCalculator;
} // namespace fastcdr
} // namespace eprosima



/*!
* @brief This class represents the structure HelloWorld defined by the user in the IDL file.
* @ingroup HelloWorld
Expand Down Expand Up @@ -142,6 +146,7 @@ class HelloWorld
*/
eProsima_user_DllExport uint32_t& index();


/*!
* @brief This function copies the value in member message
* @param _message New value to be copied in member message
Expand All @@ -168,67 +173,10 @@ class HelloWorld
*/
eProsima_user_DllExport std::array<char, 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 returns the maximum serialized size of the Key of an object
* depending on the buffer alignment.
* @param current_alignment Buffer alignment.
* @return Maximum serialized size.
*/
eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(
size_t current_alignment = 0);

/*!
* @brief This function tells you if the Key has been defined for this type
*/
eProsima_user_DllExport static bool isKeyDefined();

/*!
* @brief This function serializes the key members of an object using CDR serialization.
* @param cdr CDR serialization object.
*/
eProsima_user_DllExport void serializeKey(
eprosima::fastcdr::Cdr& cdr) const;

private:

uint32_t m_index;
std::array<char, 20> m_message;
uint32_t m_index{0};
std::array<char, 20> m_message{0};

};

Expand Down
45 changes: 45 additions & 0 deletions examples/cpp/dds/AdvancedConfigurationExample/HelloWorldCdrAux.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/*!
* @file HelloWorldCdrAux.hpp
* This source file contains some definitions of CDR related functions.
*
* This file was generated by the tool fastddsgen.
*/

#ifndef _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_
#define _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_

#include "HelloWorld.h"

constexpr uint32_t HelloWorld_max_cdr_typesize {28UL};
constexpr uint32_t HelloWorld_max_key_cdr_typesize {0UL};


namespace eprosima {
namespace fastcdr {

class Cdr;
class CdrSizeCalculator;

eProsima_user_DllExport void serialize_key(
eprosima::fastcdr::Cdr& scdr,
const HelloWorld& data);


} // namespace fastcdr
} // namespace eprosima

#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_
Loading
Loading