From 9a741c24b5d392d73492ec5edd0fbdb2496794d3 Mon Sep 17 00:00:00 2001 From: Miguel Company Date: Tue, 25 Jun 2024 14:28:31 +0200 Subject: [PATCH] Refs #21137. Apply review suggestions. Signed-off-by: Miguel Company --- include/fastdds/rtps/history/WriterHistory.hpp | 17 ++++++++++++++++- src/cpp/rtps/history/WriterHistory.cpp | 3 +-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/include/fastdds/rtps/history/WriterHistory.hpp b/include/fastdds/rtps/history/WriterHistory.hpp index a3028efdda6..ea07512573d 100644 --- a/include/fastdds/rtps/history/WriterHistory.hpp +++ b/include/fastdds/rtps/history/WriterHistory.hpp @@ -58,15 +58,30 @@ class WriterHistory : public rtps::History public: /** - * Constructor of the WriterHistory. + * @brief Construct a WriterHistory. + * + * @param att Attributes configuring the WriterHistory. */ FASTDDS_EXPORTED_API WriterHistory( const HistoryAttributes& att); + /** + * @brief Construct a WriterHistory with a custom payload pool. + * + * @param att Attributes configuring the WriterHistory. + * @param payload_pool Pool of payloads to be used by the WriterHistory. + */ FASTDDS_EXPORTED_API WriterHistory( const HistoryAttributes& att, const std::shared_ptr& payload_pool); + /** + * @brief Construct a WriterHistory with custom payload and change pools. + * + * @param att Attributes configuring the WriterHistory. + * @param payload_pool Pool of payloads to be used by the WriterHistory. + * @param change_pool Pool of changes to be used by the WriterHistory. + */ FASTDDS_EXPORTED_API WriterHistory( const HistoryAttributes& att, const std::shared_ptr& payload_pool, diff --git a/src/cpp/rtps/history/WriterHistory.cpp b/src/cpp/rtps/history/WriterHistory.cpp index 764c855ccb2..9df5f827992 100644 --- a/src/cpp/rtps/history/WriterHistory.cpp +++ b/src/cpp/rtps/history/WriterHistory.cpp @@ -87,10 +87,9 @@ WriterHistory::WriterHistory( const HistoryAttributes& att, const std::shared_ptr& payload_pool) : History(att) + , change_pool_(std::make_shared(PoolConfig::from_history_attributes(att))) , payload_pool_(payload_pool) { - PoolConfig cfg = PoolConfig::from_history_attributes(att); - change_pool_ = std::make_shared(cfg); } WriterHistory::WriterHistory(