Skip to content

Commit

Permalink
Link SHM locator kind with Fast DDS major version (#5116)
Browse files Browse the repository at this point in the history
Signed-off-by: eduponz <eduardoponz@eprosima.com>
  • Loading branch information
EduPonz authored Jul 30, 2024
1 parent 9295047 commit 0b671f2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
21 changes: 10 additions & 11 deletions include/fastdds/rtps/common/Locator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,18 @@
#ifndef FASTDDS_RTPS_COMMON__LOCATOR_HPP
#define FASTDDS_RTPS_COMMON__LOCATOR_HPP

#include <fastdds/fastdds_dll.hpp>

#include <fastdds/rtps/common/Types.hpp>
#include <fastdds/utils/IPLocator.hpp>

#include <fastdds/dds/log/Log.hpp>

#include <sstream>
#include <vector>
#include <algorithm>
#include <cstdint>
#include <cstring>
#include <iomanip>
#include <algorithm>
#include <sstream>
#include <vector>

#include <fastdds/config.hpp>
#include <fastdds/dds/log/Log.hpp>
#include <fastdds/fastdds_dll.hpp>
#include <fastdds/rtps/common/Types.hpp>
#include <fastdds/utils/IPLocator.hpp>

namespace eprosima {
namespace fastdds {
Expand Down Expand Up @@ -61,7 +60,7 @@ namespace rtps {
/// TCP over IPv6 locator kind
#define LOCATOR_KIND_TCPv6 8
/// Shared memory locator kind
#define LOCATOR_KIND_SHM 16
#define LOCATOR_KIND_SHM 16 + FASTDDS_VERSION_MAJOR

/**
* @brief Class Locator_t, uniquely identifies a communication channel for a particular transport.
Expand Down
14 changes: 9 additions & 5 deletions src/cpp/rtps/transport/shared_mem/SharedMemGlobal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,20 @@
#define _FASTDDS_SHAREDMEM_GLOBAL_H_

#include <algorithm>
#include <vector>
#include <mutex>
#include <memory>
#include <mutex>
#include <thread>
#include <vector>

#include <utils/shared_memory/SharedMemSegment.hpp>
#include <fastdds/config.hpp>
#include <fastdds/rtps/common/Locator.hpp>

#include <rtps/transport/shared_mem/MultiProducerConsumerRingBuffer.hpp>
#include <utils/shared_memory/RobustExclusiveLock.hpp>
#include <utils/shared_memory/RobustSharedLock.hpp>
#include <utils/shared_memory/SharedMemSegment.hpp>
#include <utils/shared_memory/SharedMemWatchdog.hpp>

#include <rtps/transport/shared_mem/MultiProducerConsumerRingBuffer.hpp>

#define THREADID "(ID:" << std::this_thread::get_id() << ") "

namespace eprosima {
Expand Down Expand Up @@ -92,6 +94,8 @@ class SharedMemGlobal
typedef MultiProducerConsumerRingBuffer<BufferDescriptor>::Cell PortCell;

static const uint32_t CURRENT_ABI_VERSION = 5;
static_assert(CURRENT_ABI_VERSION == (2 + FASTDDS_VERSION_MAJOR), "ABI is not correct");
static_assert(LOCATOR_KIND_SHM == (16 + FASTDDS_VERSION_MAJOR), "LOCATOR_KIND_SHM is not correct");

struct PortNode
{
Expand Down
1 change: 1 addition & 0 deletions versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ Forthcoming
* DDS implementation of `eprosima::fastdds::Time_t` moved to `eprosima::fastdds::dds::Time_t`.
* `TopicDataType::auto_fill_type_information` has been removed in favor of `fastdds.type_propagation` participant property.
* Add new custom pid PID_PRODUCT_VERSION.
* SHM locator kind is now linked to Fast DDS' major version.

Version 2.14.0
--------------
Expand Down

0 comments on commit 0b671f2

Please sign in to comment.