Skip to content

Commit 0226293

Browse files
committed
Refs #21129: fix errors after reader refactor
Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com>
1 parent f3948b0 commit 0226293

8 files changed

Lines changed: 172 additions & 177 deletions

File tree

src/cpp/fastdds/subscriber/DataReaderImpl.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ class DataReaderImpl
570570
bool trigger_value);
571571

572572
void update_subscription_matched_status(
573-
const fastrtps::rtps::MatchingInfo& status);
573+
const fastdds::rtps::MatchingInfo& status);
574574

575575
bool on_data_available(
576576
const fastdds::rtps::GUID_t& writer_guid,

src/cpp/rtps/reader/BaseReader.cpp

Lines changed: 58 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,18 @@
4646
namespace eprosima {
4747
namespace fastdds {
4848
namespace rtps {
49-
50-
using namespace fastrtps::rtps;
51-
49+
5250
BaseReader::BaseReader(
53-
fastrtps::rtps::RTPSParticipantImpl* pimpl,
54-
const fastrtps::rtps::GUID_t& guid,
55-
const fastrtps::rtps::ReaderAttributes& att,
56-
fastrtps::rtps::ReaderHistory* hist,
57-
fastrtps::rtps::ReaderListener* listen)
58-
: fastrtps::rtps::RTPSReader(pimpl, guid, att, hist)
51+
fastdds::rtps::RTPSParticipantImpl* pimpl,
52+
const fastdds::rtps::GUID_t& guid,
53+
const fastdds::rtps::ReaderAttributes& att,
54+
fastdds::rtps::ReaderHistory* hist,
55+
fastdds::rtps::ReaderListener* listen)
56+
: fastdds::rtps::RTPSReader(pimpl, guid, att, hist)
5957
, listener_(listen)
6058
, accept_messages_from_unkown_writers_(att.accept_messages_from_unkown_writers)
6159
, expects_inline_qos_(att.expects_inline_qos)
62-
, history_state_(new fastrtps::rtps::ReaderHistoryState(att.matched_writers_allocation.initial))
60+
, history_state_(new fastdds::rtps::ReaderHistoryState(att.matched_writers_allocation.initial))
6361
, liveliness_kind_(att.liveliness_kind)
6462
, liveliness_lease_duration_(att.liveliness_lease_duration)
6563
{
@@ -73,12 +71,12 @@ BaseReader::BaseReader(
7371
}
7472

7573
BaseReader::BaseReader(
76-
fastrtps::rtps::RTPSParticipantImpl* pimpl,
77-
const fastrtps::rtps::GUID_t& guid,
78-
const fastrtps::rtps::ReaderAttributes& att,
79-
const std::shared_ptr<fastrtps::rtps::IPayloadPool>& payload_pool,
80-
fastrtps::rtps::ReaderHistory* hist,
81-
fastrtps::rtps::ReaderListener* listen)
74+
fastdds::rtps::RTPSParticipantImpl* pimpl,
75+
const fastdds::rtps::GUID_t& guid,
76+
const fastdds::rtps::ReaderAttributes& att,
77+
const std::shared_ptr<fastdds::rtps::IPayloadPool>& payload_pool,
78+
fastdds::rtps::ReaderHistory* hist,
79+
fastdds::rtps::ReaderListener* listen)
8280
: BaseReader(
8381
pimpl, guid, att, payload_pool,
8482
std::make_shared<CacheChangePool>(PoolConfig::from_history_attributes(hist->m_att)),
@@ -87,18 +85,18 @@ BaseReader::BaseReader(
8785
}
8886

8987
BaseReader::BaseReader(
90-
fastrtps::rtps::RTPSParticipantImpl* pimpl,
91-
const fastrtps::rtps::GUID_t& guid,
92-
const fastrtps::rtps::ReaderAttributes& att,
93-
const std::shared_ptr<fastrtps::rtps::IPayloadPool>& payload_pool,
94-
const std::shared_ptr<fastrtps::rtps::IChangePool>& change_pool,
95-
fastrtps::rtps::ReaderHistory* hist,
96-
fastrtps::rtps::ReaderListener* listen)
97-
: fastrtps::rtps::RTPSReader(pimpl, guid, att, hist)
88+
fastdds::rtps::RTPSParticipantImpl* pimpl,
89+
const fastdds::rtps::GUID_t& guid,
90+
const fastdds::rtps::ReaderAttributes& att,
91+
const std::shared_ptr<fastdds::rtps::IPayloadPool>& payload_pool,
92+
const std::shared_ptr<fastdds::rtps::IChangePool>& change_pool,
93+
fastdds::rtps::ReaderHistory* hist,
94+
fastdds::rtps::ReaderListener* listen)
95+
: fastdds::rtps::RTPSReader(pimpl, guid, att, hist)
9896
, listener_(listen)
9997
, accept_messages_from_unkown_writers_(att.accept_messages_from_unkown_writers)
10098
, expects_inline_qos_(att.expects_inline_qos)
101-
, history_state_(new fastrtps::rtps::ReaderHistoryState(att.matched_writers_allocation.initial))
99+
, history_state_(new fastdds::rtps::ReaderHistoryState(att.matched_writers_allocation.initial))
102100
, liveliness_kind_(att.liveliness_kind)
103101
, liveliness_lease_duration_(att.liveliness_lease_duration)
104102
{
@@ -173,7 +171,7 @@ uint64_t BaseReader::get_unread_count(
173171
{
174172
for (auto it = history_->changesBegin(); 0 < total_unread_ && it != history_->changesEnd(); ++it)
175173
{
176-
fastrtps::rtps::CacheChange_t* change = *it;
174+
fastdds::rtps::CacheChange_t* change = *it;
177175
if (!change->isRead && get_last_notified(change->writerGUID) >= change->sequenceNumber)
178176
{
179177
change->isRead = true;
@@ -187,7 +185,7 @@ uint64_t BaseReader::get_unread_count(
187185
}
188186

189187
bool BaseReader::wait_for_unread_cache(
190-
const eprosima::fastrtps::Duration_t& timeout)
188+
const eprosima::fastdds::Duration_t& timeout)
191189
{
192190
auto time_out = std::chrono::steady_clock::now() + std::chrono::seconds(timeout.seconds) +
193191
std::chrono::nanoseconds(timeout.nanosec);
@@ -215,16 +213,16 @@ bool BaseReader::wait_for_unread_cache(
215213

216214
bool BaseReader::is_sample_valid(
217215
const void* data,
218-
const fastrtps::rtps::GUID_t& writer,
219-
const fastrtps::rtps::SequenceNumber_t& sn) const
216+
const fastdds::rtps::GUID_t& writer,
217+
const fastdds::rtps::SequenceNumber_t& sn) const
220218
{
221219
if (is_datasharing_compatible_ && datasharing_listener_->writer_is_matched(writer))
222220
{
223221
// Check if the payload is dirty
224222
// Note the Payloads used in loans include a mandatory RTPS 2.3 extra header
225-
auto payload = static_cast<const fastrtps::rtps::octet*>(data);
226-
payload -= fastrtps::rtps::SerializedPayload_t::representation_header_size;
227-
if (!fastrtps::rtps::DataSharingPayloadPool::check_sequence_number(payload, sn))
223+
auto payload = static_cast<const fastdds::rtps::octet*>(data);
224+
payload -= fastdds::rtps::SerializedPayload_t::representation_header_size;
225+
if (!fastdds::rtps::DataSharingPayloadPool::check_sequence_number(payload, sn))
228226
{
229227
return false;
230228
}
@@ -233,34 +231,34 @@ bool BaseReader::is_sample_valid(
233231
}
234232

235233
BaseReader* BaseReader::downcast(
236-
fastrtps::rtps::RTPSReader* reader)
234+
fastdds::rtps::RTPSReader* reader)
237235
{
238236
assert(nullptr != dynamic_cast<BaseReader*>(reader));
239237
return static_cast<BaseReader*>(reader);
240238
}
241239

242240
BaseReader* BaseReader::downcast(
243-
fastrtps::rtps::Endpoint* endpoint)
241+
fastdds::rtps::Endpoint* endpoint)
244242
{
245243
assert(nullptr != dynamic_cast<BaseReader*>(endpoint));
246244
return static_cast<BaseReader*>(endpoint);
247245
}
248246

249247
void BaseReader::allow_unknown_writers()
250248
{
251-
assert(fastrtps::rtps::EntityId_t::unknown() != trusted_writer_entity_id_);
249+
assert(fastdds::rtps::EntityId_t::unknown() != trusted_writer_entity_id_);
252250
accept_messages_from_unkown_writers_ = true;
253251
}
254252

255253
bool BaseReader::reserve_cache(
256254
uint32_t cdr_payload_size,
257-
fastrtps::rtps::CacheChange_t*& change)
255+
fastdds::rtps::CacheChange_t*& change)
258256
{
259257
std::lock_guard<decltype(mp_mutex)> guard(mp_mutex);
260258

261259
change = nullptr;
262260

263-
fastrtps::rtps::CacheChange_t* reserved_change = nullptr;
261+
fastdds::rtps::CacheChange_t* reserved_change = nullptr;
264262
if (!change_pool_->reserve_cache(reserved_change))
265263
{
266264
EPROSIMA_LOG_WARNING(RTPS_READER, "Problem reserving cache from pool");
@@ -280,11 +278,11 @@ bool BaseReader::reserve_cache(
280278
}
281279

282280
void BaseReader::release_cache(
283-
fastrtps::rtps::CacheChange_t* change)
281+
fastdds::rtps::CacheChange_t* change)
284282
{
285283
std::lock_guard<decltype(mp_mutex)> guard(mp_mutex);
286284

287-
fastrtps::rtps::IPayloadPool* pool = change->payload_owner();
285+
fastdds::rtps::IPayloadPool* pool = change->payload_owner();
288286
if (pool)
289287
{
290288
pool->release_payload(*change);
@@ -293,7 +291,7 @@ void BaseReader::release_cache(
293291
}
294292

295293
void BaseReader::update_liveliness_changed_status(
296-
const fastrtps::rtps::GUID_t& writer,
294+
const fastdds::rtps::GUID_t& writer,
297295
int32_t alive_change,
298296
int32_t not_alive_change)
299297
{
@@ -343,10 +341,10 @@ bool BaseReader::may_remove_history_record(
343341
}
344342

345343
void BaseReader::add_persistence_guid(
346-
const fastrtps::rtps::GUID_t& guid,
347-
const fastrtps::rtps::GUID_t& persistence_guid)
344+
const fastdds::rtps::GUID_t& guid,
345+
const fastdds::rtps::GUID_t& persistence_guid)
348346
{
349-
if (fastrtps::rtps::c_Guid_Unknown == persistence_guid || persistence_guid == guid)
347+
if (fastdds::rtps::c_Guid_Unknown == persistence_guid || persistence_guid == guid)
350348
{
351349
std::lock_guard<decltype(mp_mutex)> guard(mp_mutex);
352350
history_state_->persistence_guid_map[guid] = guid;
@@ -373,12 +371,12 @@ void BaseReader::add_persistence_guid(
373371
}
374372

375373
void BaseReader::remove_persistence_guid(
376-
const fastrtps::rtps::GUID_t& guid,
377-
const fastrtps::rtps::GUID_t& persistence_guid,
374+
const fastdds::rtps::GUID_t& guid,
375+
const fastdds::rtps::GUID_t& persistence_guid,
378376
bool removed_by_lease)
379377
{
380378
std::lock_guard<decltype(mp_mutex)> guard(mp_mutex);
381-
auto persistence_guid_stored = (fastrtps::rtps::c_Guid_Unknown == persistence_guid) ? guid : persistence_guid;
379+
auto persistence_guid_stored = (fastdds::rtps::c_Guid_Unknown == persistence_guid) ? guid : persistence_guid;
382380
history_state_->persistence_guid_map.erase(guid);
383381
auto count = --history_state_->persistence_guid_count[persistence_guid_stored];
384382
if (count <= 0 && may_remove_history_record(removed_by_lease))
@@ -388,12 +386,12 @@ void BaseReader::remove_persistence_guid(
388386
}
389387
}
390388

391-
fastrtps::rtps::SequenceNumber_t BaseReader::get_last_notified(
392-
const fastrtps::rtps::GUID_t& guid)
389+
fastdds::rtps::SequenceNumber_t BaseReader::get_last_notified(
390+
const fastdds::rtps::GUID_t& guid)
393391
{
394-
fastrtps::rtps::SequenceNumber_t ret_val;
392+
fastdds::rtps::SequenceNumber_t ret_val;
395393
std::lock_guard<decltype(mp_mutex)> guard(mp_mutex);
396-
fastrtps::rtps::GUID_t guid_to_look = guid;
394+
fastdds::rtps::GUID_t guid_to_look = guid;
397395
auto p_guid = history_state_->persistence_guid_map.find(guid);
398396
if (p_guid != history_state_->persistence_guid_map.end())
399397
{
@@ -409,13 +407,13 @@ fastrtps::rtps::SequenceNumber_t BaseReader::get_last_notified(
409407
return ret_val;
410408
}
411409

412-
fastrtps::rtps::SequenceNumber_t BaseReader::update_last_notified(
413-
const fastrtps::rtps::GUID_t& guid,
414-
const fastrtps::rtps::SequenceNumber_t& seq)
410+
fastdds::rtps::SequenceNumber_t BaseReader::update_last_notified(
411+
const fastdds::rtps::GUID_t& guid,
412+
const fastdds::rtps::SequenceNumber_t& seq)
415413
{
416-
fastrtps::rtps::SequenceNumber_t ret_val;
414+
fastdds::rtps::SequenceNumber_t ret_val;
417415
std::lock_guard<decltype(mp_mutex)> guard(mp_mutex);
418-
fastrtps::rtps::GUID_t guid_to_look = guid;
416+
fastdds::rtps::GUID_t guid_to_look = guid;
419417
auto p_guid = history_state_->persistence_guid_map.find(guid);
420418
if (p_guid != history_state_->persistence_guid_map.end())
421419
{
@@ -439,16 +437,16 @@ fastrtps::rtps::SequenceNumber_t BaseReader::update_last_notified(
439437
}
440438

441439
void BaseReader::persist_last_notified_nts(
442-
const fastrtps::rtps::GUID_t& peristence_guid,
443-
const fastrtps::rtps::SequenceNumber_t& seq)
440+
const fastdds::rtps::GUID_t& peristence_guid,
441+
const fastdds::rtps::SequenceNumber_t& seq)
444442
{
445443
// Empty base implementation since base behavior is to not persist data
446444
static_cast<void>(peristence_guid);
447445
static_cast<void>(seq);
448446
}
449447

450448
bool BaseReader::is_datasharing_compatible_with(
451-
const fastrtps::rtps::WriterProxyData& wdata)
449+
const fastdds::rtps::WriterProxyData& wdata)
452450
{
453451
if (!is_datasharing_compatible_ ||
454452
wdata.m_qos.data_sharing.kind() == fastdds::dds::DataSharingKind::OFF)
@@ -485,9 +483,9 @@ void BaseReader::init(
485483
}
486484

487485
void BaseReader::setup_datasharing(
488-
const fastrtps::rtps::ReaderAttributes& att)
486+
const fastdds::rtps::ReaderAttributes& att)
489487
{
490-
using namespace fastrtps::rtps;
488+
using namespace fastdds::rtps;
491489

492490
if (att.endpoint.data_sharing_configuration().kind() != fastdds::dds::DataSharingKind::OFF)
493491
{

0 commit comments

Comments
 (0)