Skip to content

Commit 3bda8b0

Browse files
committed
Refs #23264: Fix windows compilation
Signed-off-by: Mario-DL <mariodominguez@eprosima.com>
1 parent 093554e commit 3bda8b0

3 files changed

Lines changed: 17 additions & 5 deletions

File tree

include/fastdds/rtps/common/WriteParams.hpp

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ class FASTDDS_EXPORTED_API WriteParams
4646
*/
4747
struct FASTDDS_EXPORTED_API UserWriteData
4848
{
49-
FASTDDS_EXPORTED_API UserWriteData() = default;
49+
UserWriteData() = default;
5050

51-
FASTDDS_EXPORTED_API virtual ~UserWriteData() = default;
51+
virtual ~UserWriteData() = default;
5252
};
5353

5454
/**
@@ -239,14 +239,26 @@ class FASTDDS_EXPORTED_API WriteParams
239239

240240
private:
241241

242+
class FASTDDS_EXPORTED_API UserWriteDataPtr : public std::shared_ptr<UserWriteData>
243+
{
244+
public:
245+
246+
UserWriteDataPtr(
247+
std::shared_ptr<UserWriteData> ptr)
248+
: std::shared_ptr<UserWriteData>(ptr)
249+
{
250+
}
251+
252+
};
253+
242254
/// Attribute that holds sample_identity member value
243255
SampleIdentity sample_identity_;
244256
/// Attribute that holds related_sample_identity member value
245257
SampleIdentity related_sample_identity_;
246258
/// Attribute that holds source_timestamp member value
247259
Time_t source_timestamp_{ -1, TIME_T_INFINITE_NANOSECONDS };
248260
/// User write data
249-
std::shared_ptr<UserWriteData> user_write_data_ = nullptr;
261+
UserWriteDataPtr user_write_data_{nullptr};
250262
};
251263

252264
} // namespace rtps

test/blackbox/common/DDSBlackboxTestsContentFilter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ TEST_P(DDSContentFilter, filter_with_prefilter)
790790
// Set a user write data on the writer to filter out samples 4 < index < 8
791791
rtps::WriteParams write_params;
792792
write_params.user_write_data(std::make_shared<CustomUserWriteData>(
793-
8u, 4u));
793+
(uint16_t)8u, (uint16_t)4u));
794794
writer.write_params(write_params);
795795

796796
auto data = default_helloworld_data_generator();

test/blackbox/common/DDSBlackboxTestsDataWriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1503,7 +1503,7 @@ TEST_P(DDSDataWriter, datawriter_prefilter_filtering_by_payload)
15031503
// Set a user write data on the writer to filter out samples with idx <= 5
15041504
rtps::WriteParams write_params;
15051505
write_params.user_write_data(std::make_shared<CustomUserWriteData>(
1506-
5u));
1506+
(uint16_t)5u));
15071507
writer.write_params(write_params);
15081508

15091509
auto data = default_helloworld_data_generator();

0 commit comments

Comments
 (0)