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

[20509] Update repository for Fast DDS 3.0.0 compatibility #111

Merged
merged 53 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
8c6ba46
Update repository for FastDDS 3.0.0 compatibility
LuciaEchevarria99 Apr 22, 2024
fb76564
Fix tests and first approximation to change Dynamic Types
LuciaEchevarria99 Apr 27, 2024
1881f1b
Fix DynTypesParticipant::on_type_discovery_ callback to register type…
LuciaEchevarria99 May 17, 2024
4896356
Change DynTypesParticipant to use RTPS Participant callbacks
LuciaEchevarria99 May 20, 2024
719ab7d
Regenarate types
LuciaEchevarria99 May 27, 2024
b3fa7e7
Add TypeIdentifiers to DdsTopic in order to pass the TypeInformation …
LuciaEchevarria99 May 29, 2024
df5125e
Apply suggested changes
LuciaEchevarria99 Jun 3, 2024
4a516a8
Apply suggested changes
LuciaEchevarria99 Jun 11, 2024
45b0a98
Regenerate types
LuciaEchevarria99 Jun 17, 2024
848fc99
Fix compilation after rebase to fastdds master
LuciaEchevarria99 Jun 20, 2024
92917c3
Continue rebasing to FastDDS master
LuciaEchevarria99 Jun 26, 2024
1648698
Change .h headers to .hpp and regenerate types
LuciaEchevarria99 Jul 3, 2024
1a02e76
Update repository with new changes in Fast DDS 3.x
LuciaEchevarria99 Jul 11, 2024
87734a0
Remove DynamicType to IDL serialization from DDSPipe
LuciaEchevarria99 Jul 16, 2024
0ca4be6
Delete public functions in PayloadPool inherited from IPayloadPool an…
LuciaEchevarria99 Jul 16, 2024
0889756
Apply suggested changes
LuciaEchevarria99 Jul 29, 2024
2ceb0de
Adjust to TopicDataType refactor and removal of WriterProxyData/Reade…
LuciaEchevarria99 Jul 30, 2024
c53312a
Update after refactor in Participant discovery information
LuciaEchevarria99 Jul 30, 2024
32ae1e8
Update after TopicAttributes removal from public API
LuciaEchevarria99 Jul 30, 2024
54db70a
Regenerate types
LuciaEchevarria99 Jul 30, 2024
f44cbb1
Fix TopicDescription in CommonReader and CommonWriter
LuciaEchevarria99 Aug 7, 2024
7374975
Apply suggested changes
LuciaEchevarria99 Aug 13, 2024
6be6daf
Remove GuidPrefix attribute from DiscoveryServerConnectionAddress
LuciaEchevarria99 Aug 13, 2024
edb5450
Remove is_keyed_ method after Publication/SubscriptionBuiltinTopicDat…
LuciaEchevarria99 Aug 13, 2024
70e8001
Fix CacheChangePool after rebase
LuciaEchevarria99 Aug 16, 2024
bd98813
Fix tests
LuciaEchevarria99 Aug 16, 2024
9126924
Fix uncrustify
LuciaEchevarria99 Aug 19, 2024
d0a5ad2
Free allocated memory in PayloadPool::release_
LuciaEchevarria99 Aug 19, 2024
becfdea
Fill TypeInformation in Topic Description just from complete TypeIden…
LuciaEchevarria99 Sep 2, 2024
9b2873d
Apply suggested changes
LuciaEchevarria99 Sep 3, 2024
a35d46e
Make payload_owner=nullptr in PayloadPool::release_ before empty() to…
LuciaEchevarria99 Sep 3, 2024
a064438
Add assertion making sure TypeIdentifier is complete before calling a…
LuciaEchevarria99 Sep 4, 2024
9fc0456
Apply suggested changes
LuciaEchevarria99 Sep 4, 2024
34c57cd
Refactor rtps participants reckon_participant_attributes_
LuciaEchevarria99 Sep 5, 2024
3d370e7
Accept v6 interfaces and interface names in whitelist (#128)
juanlofer-eprosima Sep 6, 2024
5cce977
Make DiscoveryServer servers' guid prefix optional (#129)
juanlofer-eprosima Sep 9, 2024
1a0295c
Add missing suggested changes
LuciaEchevarria99 Sep 9, 2024
80cca3a
Correct type_kind_to_str output for TK_CHAR8 case
LuciaEchevarria99 Sep 9, 2024
2df989c
Remove unnecessary CacheChange include
LuciaEchevarria99 Sep 9, 2024
9534f79
Implement add_qos_properties_ in reckon_participant_qos_
LuciaEchevarria99 Sep 9, 2024
44c01d7
Remove Fast-DDS API ReturnCode explanation in PayloadPoolMediator::write
LuciaEchevarria99 Sep 9, 2024
7e12adc
Change name ip_configuration -> initial_peers_configuration
LuciaEchevarria99 Sep 9, 2024
3490845
Change name ds_configuration -> discovery_server_configuration
LuciaEchevarria99 Sep 9, 2024
74daf38
Use dynamic_pointer_cast instead of static_pointer_cast in reckon_par…
LuciaEchevarria99 Sep 9, 2024
aac932c
Change function descriptions in CommonParticipant
LuciaEchevarria99 Sep 9, 2024
225fdb6
CHange char sequence message in tests
LuciaEchevarria99 Sep 9, 2024
aa1a682
Add clarification comment in TopicDataType::compute_key(SerializedPay…
LuciaEchevarria99 Sep 9, 2024
fa147dc
Fix YamlGetEntityGuidPrefixTest.get_guidprefix_explicitly test
LuciaEchevarria99 Sep 9, 2024
d2fa3fa
Add comment clarifying the order of TypeIdentifiers (complete and min…
LuciaEchevarria99 Sep 10, 2024
3012a05
Fix Windows compilation
LuciaEchevarria99 Sep 10, 2024
75062c8
Uncrustify
LuciaEchevarria99 Sep 10, 2024
b0c8072
Check if ParticipantConfiguration is nullptr after cast in reckon_par…
LuciaEchevarria99 Sep 10, 2024
5154606
Fix uncrustify
LuciaEchevarria99 Sep 10, 2024
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
  •  
  •  
  •  
9 changes: 0 additions & 9 deletions ddspipe_core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,6 @@ file(
"${PROJECT_SOURCE_DIR}/include/*.h*"
)

# Exclude types' files depending on the Fast DDS version
if ("${fastrtps_VERSION}" VERSION_LESS 2.13)
list(FILTER SOURCES_FILES EXCLUDE REGEX "v2/")
list(FILTER HEADERS_FILES EXCLUDE REGEX "v2/")
else()
list(FILTER SOURCES_FILES EXCLUDE REGEX "v1/")
list(FILTER HEADERS_FILES EXCLUDE REGEX "v1/")
endif()

# Compile C++ library
compile_library(
"${PROJECT_SOURCE_DIR}/src/cpp" # Source directory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <map>
#include <mutex>

#include <fastdds/rtps/common/SampleIdentity.h>
#include <fastdds/rtps/common/SampleIdentity.hpp>

#include <ddspipe_core/types/dds/Guid.hpp>
#include <ddspipe_core/types/participant/ParticipantId.hpp>
Expand All @@ -28,9 +28,9 @@ namespace eprosima {
namespace ddspipe {
namespace core {

using SampleIdentity = eprosima::fastrtps::rtps::SampleIdentity;
using SampleIdentity = eprosima::fastdds::rtps::SampleIdentity;

using SequenceNumber = eprosima::fastrtps::rtps::SequenceNumber_t;
using SequenceNumber = eprosima::fastdds::rtps::SequenceNumber_t;

/**
* Class used to store the information associated to a service request, so its reply can be forwarded through the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ struct DdsPublishingConfiguration : public IConfiguration

//! The DDS topic name to publish in.
std::string topic_name{};

//! Whether the LogEntry type should be published or not.
bool publish_type = false;
};

} /* namespace core */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
#include <string>
#include <thread>

#include <fastrtps/utils/DBQueue.h>
#include <cpp_utils/queue/DBQueue.hpp>
juanlofer-eprosima marked this conversation as resolved.
Show resolved Hide resolved
#include <cpp_utils/ReturnCode.hpp>

#include <ddspipe_core/types/dds/Endpoint.hpp>
#include <ddspipe_core/types/dds/Guid.hpp>
#include <cpp_utils/ReturnCode.hpp>
#include <ddspipe_core/types/topic/dds/DistributedTopic.hpp>

namespace eprosima {
Expand Down Expand Up @@ -263,7 +263,7 @@ class DiscoveryDatabase
mutable std::mutex callbacks_mutex_;

//! Queue storing database operations to be performed in a dedicated thread
fastrtps::DBQueue<std::tuple<DatabaseOperation, types::Endpoint>> entities_to_process_;
utils::event::DBQueue<std::tuple<DatabaseOperation, types::Endpoint>> entities_to_process_;

//! Handle of thread dedicated to performing database operations
std::thread queue_processing_thread_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,16 @@ class CopyPayloadPool : public PayloadPool
//! Reserve a new memory space
bool get_payload(
uint32_t size,
types::Payload& payload) override;
eprosima::fastdds::rtps::SerializedPayload_t& payload) override;

//! Reserve a new memory space and copy the data from \c src_payload to \c target_payload
bool get_payload(
const types::Payload& src_payload,
IPayloadPool*& data_owner,
types::Payload& target_payload) override;
const eprosima::fastdds::rtps::SerializedPayload_t& src_payload,
eprosima::fastdds::rtps::SerializedPayload_t& target_payload) override;

//! Release data in \c payload
bool release_payload(
types::Payload& payload) override;
eprosima::fastdds::rtps::SerializedPayload_t& payload) override;
};

} /* namespace core */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ typedef std::atomic<unsigned int> MetaInfoType;
* This class is used to manage the allocation and release of the payloads used within the Router.
* The main target is not to copy or alloc data that is already in memory, but to reuse it safely.
*
* This implementation uses an idea get from TopicPayloadPool from fastrtps.
* This implementation uses an idea get from TopicPayloadPool from fastdds.
* This is, to alloc more space than required whenever a new payload is needed, and in this extra space (at the
* beginning of the data) stores the number of references this data has.
* As long as this number does not reach 0, the data is not deleted.
Expand Down Expand Up @@ -76,7 +76,7 @@ class FastPayloadPool : public PayloadPool
DDSPIPE_CORE_DllAPI
bool get_payload(
uint32_t size,
types::Payload& payload) override;
eprosima::fastdds::rtps::SerializedPayload_t& payload) override;

/**
* Reserve in \c target_payload the payload in \c src_payload .
Expand All @@ -95,9 +95,8 @@ class FastPayloadPool : public PayloadPool
*/
DDSPIPE_CORE_DllAPI
bool get_payload(
const types::Payload& src_payload,
IPayloadPool*& data_owner,
types::Payload& target_payload) override;
const eprosima::fastdds::rtps::SerializedPayload_t& src_payload,
eprosima::fastdds::rtps::SerializedPayload_t& payload) override;

/**
* Release a payload that has been reserved from this pool.
Expand All @@ -113,7 +112,7 @@ class FastPayloadPool : public PayloadPool
*/
DDSPIPE_CORE_DllAPI
bool release_payload(
types::Payload& payload) override;
eprosima::fastdds::rtps::SerializedPayload_t& payload) override;

protected:

Expand All @@ -132,7 +131,7 @@ class FastPayloadPool : public PayloadPool
DDSPIPE_CORE_DllAPI
virtual bool reserve_(
uint32_t size,
types::Payload& payload) override;
eprosima::fastdds::rtps::SerializedPayload_t& payload) override;

/**
* @brief Reimplement parent \c release_ method
Expand All @@ -146,7 +145,7 @@ class FastPayloadPool : public PayloadPool
*/
DDSPIPE_CORE_DllAPI
virtual bool release_(
types::Payload& payload) override;
eprosima::fastdds::rtps::SerializedPayload_t& payload) override;
};

} /* namespace core */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class MapPayloadPool : public PayloadPool
*/
bool get_payload(
uint32_t size,
types::Payload& payload) override;
eprosima::fastdds::rtps::SerializedPayload_t& payload) override;

/**
* @brief Set \c target_payload data to \c src_payload .
Expand All @@ -78,9 +78,8 @@ class MapPayloadPool : public PayloadPool
* @throw utils::InconsistencyException if \c data_owner is \c this but the data in \c src_payload is not from this pool.
*/
bool get_payload(
const types::Payload& src_payload,
IPayloadPool*& data_owner,
types::Payload& target_payload) override;
const eprosima::fastdds::rtps::SerializedPayload_t& src_payload,
eprosima::fastdds::rtps::SerializedPayload_t& payload) override;

/**
* @brief Decrease reference counter for data in \c payload .
Expand All @@ -96,7 +95,7 @@ class MapPayloadPool : public PayloadPool
* @throw utils::InconsistencyException if the data in \c payload is not from this pool.
*/
bool release_payload(
types::Payload& payload) override;
eprosima::fastdds::rtps::SerializedPayload_t& payload) override;

protected:

Expand Down
153 changes: 2 additions & 151 deletions ddspipe_core/include/ddspipe_core/efficiency/payload/PayloadPool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@

#include <atomic>

#include <fastdds/rtps/common/CacheChange.h>
#include <fastdds/rtps/common/SerializedPayload.h>
#include <fastdds/rtps/history/IPayloadPool.h>
#include <fastdds/rtps/history/IPayloadPool.hpp>

#include <ddspipe_core/types/dds/Payload.hpp>
juanlofer-eprosima marked this conversation as resolved.
Show resolved Hide resolved

Expand All @@ -38,7 +36,7 @@ namespace core {
* Then, this payload will be moved to the Track. As the payload is already in the pool, there will be no copy.
* Finally, the payload will be moved to every Writer that has to send the data (ideally without copy).
*/
class PayloadPool : public eprosima::fastrtps::rtps::IPayloadPool
class PayloadPool : public eprosima::fastdds::rtps::IPayloadPool
{
public:

Expand All @@ -50,153 +48,6 @@ class PayloadPool : public eprosima::fastrtps::rtps::IPayloadPool
DDSPIPE_CORE_DllAPI
virtual ~PayloadPool();

/////
// FAST DDS PART

/**
* @brief Reserve in \c cache_change a new payload of max size \c size .
*
* It sets values to the serialized payload inside \c cache_change .
* This method calls \c get_payload for the serialized payload.
* The \c cache_change owner is set to \c this .
*
* @warning length value in \c payload is not modified.
*
* @note This method may reserve new memory.
*
* @param [in] size : Size in bytes of the payload that will be reserved
* @param [out] cache_change : the cache change which SerializedPayload will be set
*
* @return true if everything ok
* @return false if something went wrong
*
* @pre Fields @c cache_change must not have the serialized payload initialized.
*/
DDSPIPE_CORE_DllAPI
virtual bool get_payload(
uint32_t size,
eprosima::fastrtps::rtps::CacheChange_t& cache_change) override; // TODO add noexcept once is implemented

/**
* @brief Store in \c cache_change the \c data payload.
*
* This method set \c cache_change serialized payload to the same data in \c data .
* This method should reuse \c data and not copy it in case the owner of \c data is \c this .
* It sets values to the serialized payload inside \c cache_change .
*
* This method calls \c get_payload for the serialized payload.
* The \c cache_change owner is set to \c this .
*
* @note This method may reserve new memory in case the owner is not \c this .
*
* @param [in,out] data Serialized payload received
* @param [in,out] data_owner Payload pool owning incoming data \c data
* @param [in,out] cache_change Cache change to assign the payload to
*
* @warning @c data_owner can only be changed from @c nullptr to @c this. If a value different from
* @c nullptr is received it should be left unchanged.
*
* @return true if everything ok
* @return false if something went wrong
*
* @pre Fields @c cache_change must not have the serialized payload initialized.
*/
DDSPIPE_CORE_DllAPI
virtual bool get_payload(
eprosima::fastrtps::rtps::SerializedPayload_t& data,
IPayloadPool*& data_owner,
eprosima::fastrtps::rtps::CacheChange_t& cache_change) override; // TODO add noexcept once is implemented

/**
* @brief Release the data from the serialized payload inside \c cache_change .
*
* @note This method must only release the actual memory of a data in case nobody is referencing it anymore.
*
* This method calls \c release_payload for the serialized payload.
* The \c cache_change owner is set to \c nullptr .
*
* @param [in,out] cache_change Cache change to release the payload from
*
* @return true if everything ok
* @return false if something went wrong
*
* @throw IncosistencyException if cache change owner is other than this
*/
DDSPIPE_CORE_DllAPI
virtual bool release_payload(
eprosima::fastrtps::rtps::CacheChange_t& cache_change) override; // TODO add noexcept once is implemented

/////
// DDSPIPE PART

/**
* @brief Reserve a new data in \c payload of size \c size.
*
* It sets value \c max_size and \c data of \c payload .
*
* @note This method may reserve new memory.
*
* @warning length value in \c payload is not modified.
*
* @param [in] size : Size in bytes of the payload that will be reserved
* @param [out] payload : the SerializedPayload that will be set
*
* @return true if everything ok
* @return false if something went wrong
*
* @pre Fields @c payload must not have been initialized.
*/
DDSPIPE_CORE_DllAPI
virtual bool get_payload(
uint32_t size,
types::Payload& payload) = 0;

/**
* @brief Store in \c target_payload the data from \c src_payload .
*
* This method set \c target_payload fields \c max_size , \c lenght and \c data .
* This method "should" reuse data in \c src_payload and not copy it in case \c data_owner is \c this .
*
* @note This method may reserve new memory in case the owner is not \c this .
*
* @param [in] src_payload Payload to move to target
* @param [in,out] data_owner Payload pool owning incoming data \c src_payload
* @param [out] target_payload Payload to assign the payload to
*
* @warning @c data_owner can only be changed from @c nullptr to @c this. If a value different from
* @c nullptr is received it must be left unchanged.
*
* @return true if everything ok
* @return false if something went wrong
*
* @pre Fields @c target_payload must not have been initialized.
*/
DDSPIPE_CORE_DllAPI
virtual bool get_payload(
const types::Payload& src_payload,
IPayloadPool*& data_owner,
types::Payload& target_payload) = 0;

/**
* @brief Release the data from the \c payload .
*
* @note This method must only release the actual memory of a data in case nobody is referencing it anymore.
*
* @note This method should use method \c reserve_ to reserve new memory.
*
* Reset the \c payload info.
*
* @param [in,out] payload Payload to release data from
*
* @return true if everything ok
* @return false if something went wrong
*
* @pre @c payload must have been initialized from this pool.
*/
DDSPIPE_CORE_DllAPI
virtual bool release_payload(
types::Payload& payload) = 0;

//! Wether every payload get has been released.
DDSPIPE_CORE_DllAPI
virtual bool is_clean() const noexcept;
Expand Down
Loading
Loading