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

Update repository for Fast DDS 3.0.0 compatibility #141

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions controller/controller_tool/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,9 @@ if (BUILD_DDSRECORDER_CONTROLLER)
# Build and install types
###############################################################################

# Determine Fast DDS version
if ("${fastrtps_VERSION}" VERSION_LESS 2.13)
set(DDS_TYPES_VERSION "v1")
else()
set(DDS_TYPES_VERSION "v2")
endif()

# Add subdirectory based on Fast DDS version
add_subdirectory(ddstypes/${DDS_TYPES_VERSION}/DdsRecorderCommand)
add_subdirectory(ddstypes/${DDS_TYPES_VERSION}/DdsRecorderStatus)
add_subdirectory(ddstypes/DdsRecorderCommand)
add_subdirectory(ddstypes/DdsRecorderStatus)

###############################################################################
# Install Tool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ message(STATUS "Configuring python wrapper for types in DdsRecorderCommand...")
project(DdsRecorderCommand)

find_package(fastcdr REQUIRED)
find_package(fastrtps REQUIRED)
find_package(fastdds REQUIRED)

set(CMAKE_POSITION_INDEPENDENT_CODE ON)

Expand All @@ -43,7 +43,7 @@ target_include_directories(${PROJECT_NAME} PUBLIC
target_link_libraries(${PROJECT_NAME}
PUBLIC
fastcdr
fastrtps
fastdds
)

###############################################################################
Expand Down Expand Up @@ -88,7 +88,7 @@ endif()

target_link_libraries(${${PROJECT_NAME}_MODULE}
Python3::Module
fastrtps
fastdds
${PROJECT_NAME}
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,19 @@
// limitations under the License.

/*!
* @file DdsRecorderCommand.h
* @file DdsRecorderCommand.hpp
* This header file contains the declaration of the described types in the IDL file.
*
* This file was generated by the tool fastddsgen.
*/

#include <fastcdr/config.h>
#include "DdsRecorderCommandv1.h"
#ifndef _FAST_DDS_GENERATED_DDSRECORDERCOMMAND_HPP_
#define _FAST_DDS_GENERATED_DDSRECORDERCOMMAND_HPP_

#if FASTCDR_VERSION_MAJOR > 1

#ifndef _FAST_DDS_GENERATED_DDSRECORDERCOMMAND_H_
#define _FAST_DDS_GENERATED_DDSRECORDERCOMMAND_H_

#include <array>
#include <bitset>
#include <cstdint>
#include <map>
#include <string>
#include <vector>

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



#if defined(_WIN32)
#if defined(EPROSIMA_USER_DLL_EXPORT)
Expand All @@ -64,17 +51,6 @@
#define DDSRECORDERCOMMAND_DllAPI
#endif // _WIN32

namespace eprosima {
namespace fastcdr {
class Cdr;
class CdrSizeCalculator;
} // namespace fastcdr
} // namespace eprosima





/*!
* @brief This class represents the structure DdsRecorderCommand defined by the user in the IDL file.
* @ingroup DdsRecorderCommand
Expand All @@ -86,107 +62,168 @@ class DdsRecorderCommand
/*!
* @brief Default constructor.
*/
eProsima_user_DllExport DdsRecorderCommand();
eProsima_user_DllExport DdsRecorderCommand()
{
}

/*!
* @brief Default destructor.
*/
eProsima_user_DllExport ~DdsRecorderCommand();
eProsima_user_DllExport ~DdsRecorderCommand()
{
}

/*!
* @brief Copy constructor.
* @param x Reference to the object DdsRecorderCommand that will be copied.
*/
eProsima_user_DllExport DdsRecorderCommand(
const DdsRecorderCommand& x);
const DdsRecorderCommand& x)
{
m_command = x.m_command;

m_args = x.m_args;

}

/*!
* @brief Move constructor.
* @param x Reference to the object DdsRecorderCommand that will be copied.
*/
eProsima_user_DllExport DdsRecorderCommand(
DdsRecorderCommand&& x) noexcept;
DdsRecorderCommand&& x) noexcept
{
m_command = std::move(x.m_command);
m_args = std::move(x.m_args);
}

/*!
* @brief Copy assignment.
* @param x Reference to the object DdsRecorderCommand that will be copied.
*/
eProsima_user_DllExport DdsRecorderCommand& operator =(
const DdsRecorderCommand& x);
const DdsRecorderCommand& x)
{

m_command = x.m_command;

m_args = x.m_args;

return *this;
}

/*!
* @brief Move assignment.
* @param x Reference to the object DdsRecorderCommand that will be copied.
*/
eProsima_user_DllExport DdsRecorderCommand& operator =(
DdsRecorderCommand&& x) noexcept;
DdsRecorderCommand&& x) noexcept
{

m_command = std::move(x.m_command);
m_args = std::move(x.m_args);
return *this;
}

/*!
* @brief Comparison operator.
* @param x DdsRecorderCommand object to compare.
*/
eProsima_user_DllExport bool operator ==(
const DdsRecorderCommand& x) const;
const DdsRecorderCommand& x) const
{
return (m_command == x.m_command &&
m_args == x.m_args);
}

/*!
* @brief Comparison operator.
* @param x DdsRecorderCommand object to compare.
*/
eProsima_user_DllExport bool operator !=(
const DdsRecorderCommand& x) const;
const DdsRecorderCommand& x) const
{
return !(*this == x);
}

/*!
* @brief This function copies the value in member command
* @param _command New value to be copied in member command
*/
eProsima_user_DllExport void command(
const std::string& _command);
const std::string& _command)
{
m_command = _command;
}

/*!
* @brief This function moves the value in member command
* @param _command New value to be moved in member command
*/
eProsima_user_DllExport void command(
std::string&& _command);
std::string&& _command)
{
m_command = std::move(_command);
}

/*!
* @brief This function returns a constant reference to member command
* @return Constant reference to member command
*/
eProsima_user_DllExport const std::string& command() const;
eProsima_user_DllExport const std::string& command() const
{
return m_command;
}

/*!
* @brief This function returns a reference to member command
* @return Reference to member command
*/
eProsima_user_DllExport std::string& command();
eProsima_user_DllExport std::string& command()
{
return m_command;
}


/*!
* @brief This function copies the value in member args
* @param _args New value to be copied in member args
*/
eProsima_user_DllExport void args(
const std::string& _args);
const std::string& _args)
{
m_args = _args;
}

/*!
* @brief This function moves the value in member args
* @param _args New value to be moved in member args
*/
eProsima_user_DllExport void args(
std::string&& _args);
std::string&& _args)
{
m_args = std::move(_args);
}

/*!
* @brief This function returns a constant reference to member args
* @return Constant reference to member args
*/
eProsima_user_DllExport const std::string& args() const;
eProsima_user_DllExport const std::string& args() const
{
return m_args;
}

/*!
* @brief This function returns a reference to member args
* @return Reference to member args
*/
eProsima_user_DllExport std::string& args();
eProsima_user_DllExport std::string& args()
{
return m_args;
}



private:

Expand All @@ -195,8 +232,6 @@ class DdsRecorderCommand

};

#endif // _FAST_DDS_GENERATED_DDSRECORDERCOMMAND_H_

#endif // _FAST_DDS_GENERATED_DDSRECORDERCOMMAND_HPP_


#endif // FASTCDR_VERSION_MAJOR > 1
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#ifndef _FAST_DDS_GENERATED_DDSRECORDERCOMMANDCDRAUX_HPP_
#define _FAST_DDS_GENERATED_DDSRECORDERCOMMANDCDRAUX_HPP_

#include "DdsRecorderCommand.h"
#include "DdsRecorderCommand.hpp"

constexpr uint32_t DdsRecorderCommand_max_cdr_typesize {524UL};
constexpr uint32_t DdsRecorderCommand_max_key_cdr_typesize {0UL};
Expand All @@ -34,8 +34,6 @@ namespace fastcdr {
class Cdr;
class CdrSizeCalculator;



eProsima_user_DllExport void serialize_key(
eprosima::fastcdr::Cdr& scdr,
const DdsRecorderCommand& data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -52,11 +50,11 @@ eProsima_user_DllExport size_t calculate_serialized_size(
current_alignment)};


calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0),
data.command(), current_alignment);
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0),
data.command(), current_alignment);

calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1),
data.args(), current_alignment);
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1),
data.args(), current_alignment);


calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment);
Expand All @@ -78,7 +76,7 @@ eProsima_user_DllExport void serialize(
scdr
<< eprosima::fastcdr::MemberId(0) << data.command()
<< eprosima::fastcdr::MemberId(1) << data.args()
;
;
scdr.end_serialize_type(current_state);
}

Expand All @@ -95,13 +93,13 @@ eProsima_user_DllExport void deserialize(
bool ret_value = true;
switch (mid.id)
{
case 0:
dcdr >> data.command();
break;
case 0:
dcdr >> data.command();
break;

case 1:
dcdr >> data.args();
break;
case 1:
dcdr >> data.args();
break;

default:
ret_value = false;
Expand All @@ -119,6 +117,8 @@ void serialize_key(
static_cast<void>(data);
}



} // namespace fastcdr
} // namespace eprosima

Expand Down
Loading