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

[19036] Link SHM locator kind with Fast DDS major version #5116

Merged
merged 1 commit into from
Jul 30, 2024
Merged
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
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
Loading