Skip to content

Commit

Permalink
Regenerate types and change fastrtps dependency to fastdds
Browse files Browse the repository at this point in the history
Signed-off-by: Lucia Echevarria <[email protected]>
  • Loading branch information
LuciaEchevarria99 committed Jul 11, 2024
1 parent 2bb44ca commit e1330cc
Show file tree
Hide file tree
Showing 25 changed files with 362 additions and 1,601 deletions.
2 changes: 1 addition & 1 deletion docs/rst/developer_manual/installation/sources/linux.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The following packages will be installed:

- ``foonathan_memory_vendor``, an STL compatible C++ memory allocation library.
- ``fastcdr``, a C++ library that serializes according to the standard CDR serialization mechanism.
- ``fastrtps``, the core library of eProsima Fast DDS library.
- ``fastdds``, the core library of eProsima Fast DDS library.
- ``cmake_utils``, an eProsima utils library for CMake.
- ``cpp_utils``, an eProsima utils library for C++.
- ``ddspipe``, an eProsima internal library that enables the communication of DDS interfaces.
Expand Down
4 changes: 2 additions & 2 deletions docs/rst/developer_manual/installation/sources/windows.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The following packages will be installed:

- ``foonathan_memory_vendor``, an STL compatible C++ memory allocation library.
- ``fastcdr``, a C++ library that serializes according to the standard CDR serialization mechanism.
- ``fastrtps``, the core library of eProsima Fast DDS library.
- ``fastdds``, the core library of eProsima Fast DDS library.
- ``cmake_utils``, an eProsima utils library for CMake.
- ``cpp_utils``, an eProsima utils library for C++.
- ``ddspipe``, an eProsima internal library that enables the communication of DDS interfaces.
Expand Down Expand Up @@ -255,7 +255,7 @@ There are two possibilities:
However, when running an instance of a |spy| compiled using CMake, it must be linked with its dependencies where the packages have been installed.
This can be done by opening the *Edit system environment variables* control panel and adding to the ``PATH`` the |espy|, *Fast DDS*, *Fast CDR*, *DDS Pipe* installation directories:

* *Fast DDS*: ``C:\\Program Files\\fastrtps``
* *Fast DDS*: ``C:\\Program Files\\fastdds``
* *Fast CDR*: ``C:\\Program Files\\fastcdr``
* *DDS Pipe*: ``C:\\Program Files\\ddspipe``
* |espy|: ``C:\\Program Files\\ddsrecord``
Expand Down
4 changes: 2 additions & 2 deletions fastddsspy_participants/test/blackbox/model/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ set(TEST_LIST

set(TEST_EXTRA_LIBRARIES
fastcdr
fastrtps
fastdds
cpp_utils
ddspipe_core
ddspipe_participants
Expand Down Expand Up @@ -80,7 +80,7 @@ set(TEST_LIST

set(TEST_EXTRA_LIBRARIES
fastcdr
fastrtps
fastdds
cpp_utils
ddspipe_core
ddspipe_participants
Expand Down
2 changes: 1 addition & 1 deletion fastddsspy_participants/test/unittest/model/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ set(TEST_LIST

set(TEST_EXTRA_LIBRARIES
fastcdr
fastrtps
fastdds
cpp_utils
ddspipe_core
ddspipe_participants
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ set(TEST_LIST

set(TEST_EXTRA_LIBRARIES
fastcdr
fastrtps
fastdds
cpp_utils
ddspipe_core
ddspipe_participants
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@
#include <fastdds/dds/publisher/DataWriterListener.hpp>
#include <fastdds/dds/topic/TypeSupport.hpp>

#if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13
#include "types/v1/HelloWorldPubSubTypes.h"
#else
#include "types/v2/HelloWorldPubSubTypes.h"
#endif // if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13
#include "types/HelloWorldPubSubTypes.hpp"

#include "types.hpp"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@
#include <fastdds/dds/domain/DomainParticipant.hpp>
#include <fastdds/dds/subscriber/DataReaderListener.hpp>

#if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13
#include "types/v1/HelloWorldPubSubTypes.h"
#else
#include "types/v2/HelloWorldPubSubTypes.h"
#endif // if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13
"types/HelloWorldPubSubTypes.hpp"

#include "types.hpp"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ if(NOT fastcdr_FOUND)
find_package(fastcdr REQUIRED)
endif()

if(NOT fastrtps_FOUND)
find_package(fastrtps REQUIRED)
if(NOT fastdds_FOUND)
find_package(fastdds REQUIRED)
endif()

#Check C++11
Expand All @@ -35,23 +35,16 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
endif()
endif()

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

message(STATUS "Configuring AdvancedConfiguration example...")
file(
GLOB ADVANCED_CONFIG_EXAMPLE_SOURCES_CXX
"*.cxx"
"types/${DDS_TYPES_VERSION}/*.cxx"
"types/*.cxx"
)
file(
GLOB ADVANCED_CONFIG_EXAMPLE_SOURCES_CPP
"*.cpp"
"types/${DDS_TYPES_VERSION}/*.cpp"
"types/*.cpp"
)

add_executable(${PROJECT_NAME} ${ADVANCED_CONFIG_EXAMPLE_SOURCES_CXX} ${ADVANCED_CONFIG_EXAMPLE_SOURCES_CPP})
Expand All @@ -61,7 +54,7 @@ target_compile_definitions(${PROJECT_NAME} PRIVATE
$<$<BOOL:${SHM_TRANSPORT_DEFAULT}>: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})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,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
```
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,18 @@
// limitations under the License.

/*!
* @file HelloWorld.h
* @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.
*/

#include <fastcdr/config.h>
#include "HelloWorldv1.h"

#if FASTCDR_VERSION_MAJOR > 1

#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_
#define _FAST_DDS_GENERATED_HELLOWORLD_H_
#ifndef FAST_DDS_GENERATED__HELLOWORLD_HPP
#define FAST_DDS_GENERATED__HELLOWORLD_HPP

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

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


#include <utility>

#if defined(_WIN32)
#if defined(EPROSIMA_USER_DLL_EXPORT)
Expand All @@ -64,17 +50,6 @@
#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
Expand All @@ -86,100 +61,158 @@ class HelloWorld
/*!
* @brief Default constructor.
*/
eProsima_user_DllExport HelloWorld();
eProsima_user_DllExport HelloWorld()
{
}

/*!
* @brief Default destructor.
*/
eProsima_user_DllExport ~HelloWorld();
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);
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;
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);
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;
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;
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;
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);
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;
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();
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<char, 20>& _message);
const std::array<char, 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(
std::array<char, 20>&& _message);
std::array<char, 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 std::array<char, 20>& message() const;
eProsima_user_DllExport const std::array<char, 20>& message() const
{
return m_message;
}

/*!
* @brief This function returns a reference to member message
* @return Reference to member message
*/
eProsima_user_DllExport std::array<char, 20>& message();
eProsima_user_DllExport std::array<char, 20>& message()
{
return m_message;
}



private:

Expand All @@ -188,8 +221,6 @@ class HelloWorld

};

#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_

#endif // _FAST_DDS_GENERATED_HELLOWORLD_HPP_


#endif // FASTCDR_VERSION_MAJOR > 1
Loading

0 comments on commit e1330cc

Please sign in to comment.