Skip to content

Commit

Permalink
Refs #21082. Use correct names for attributes.
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
  • Loading branch information
MiguelCompany committed May 30, 2024
1 parent a29941f commit b08a8aa
Show file tree
Hide file tree
Showing 7 changed files with 97 additions and 97 deletions.
14 changes: 7 additions & 7 deletions include/fastdds/rtps/reader/RTPSReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,13 @@ class RTPSReader : public Endpoint
*/
FASTDDS_EXPORTED_API inline bool expects_inline_qos()
{
return m_expectsInlineQos;
return expects_inline_qos_;
}

//! Returns a pointer to the associated History.
FASTDDS_EXPORTED_API inline ReaderHistory* get_history()
{
return mp_history;
return history_;
}

//! @return The content filter associated to this reader.
Expand All @@ -200,7 +200,7 @@ class RTPSReader : public Endpoint
FASTDDS_EXPORTED_API inline void enableMessagesFromUnkownWriters(
bool enable)
{
m_acceptMessagesFromUnkownWriters = enable;
accept_messages_from_unkown_writers_ = enable;
}

/**
Expand Down Expand Up @@ -259,13 +259,13 @@ class RTPSReader : public Endpoint
protected:

//!ReaderHistory
ReaderHistory* mp_history;
ReaderHistory* history_;
//!Listener
ReaderListener* mp_listener;
ReaderListener* listener_;
//!Accept msg from unknown writers (BE-true,RE-false)
bool m_acceptMessagesFromUnkownWriters;
bool accept_messages_from_unkown_writers_;
//!Expects Inline Qos.
bool m_expectsInlineQos;
bool expects_inline_qos_;

eprosima::fastdds::rtps::IReaderDataFilter* data_filter_ = nullptr;

Expand Down
4 changes: 2 additions & 2 deletions src/cpp/rtps/builtin/discovery/participant/PDPServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1919,7 +1919,7 @@ bool PDPServer::process_backup_restore_queue(
// else
// {
// ddb::from_json(json_change, *change_aux);
// mp_listener->onNewCacheChangeAdded(endpoints->reader.reader_, change_aux);
// listener_->onNewCacheChangeAdded(endpoints->reader.reader_, change_aux);
// }

// }
Expand Down Expand Up @@ -1963,7 +1963,7 @@ bool PDPServer::process_backup_restore_queue(
// else
// {
// ddb::from_json(json_change, *change_aux);
// mp_listener->onNewCacheChangeAdded(endpoints->reader.reader_, change_aux);
// listener_->onNewCacheChangeAdded(endpoints->reader.reader_, change_aux);
// }

// }
Expand Down
10 changes: 5 additions & 5 deletions src/cpp/rtps/reader/BaseReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ BaseReader::~BaseReader()
{
EPROSIMA_LOG_INFO(RTPS_READER, "Removing reader " << this->getGuid().entityId);

for (auto it = mp_history->changesBegin(); it != mp_history->changesEnd(); ++it)
for (auto it = history_->changesBegin(); it != history_->changesEnd(); ++it)
{
releaseCache(*it);
}
Expand All @@ -112,7 +112,7 @@ uint64_t BaseReader::get_unread_count(

if (mark_as_read)
{
for (auto it = mp_history->changesBegin(); 0 < total_unread_ && it != mp_history->changesEnd(); ++it)
for (auto it = history_->changesBegin(); 0 < total_unread_ && it != history_->changesEnd(); ++it)
{
fastrtps::rtps::CacheChange_t* change = *it;
if (!change->isRead && get_last_notified(change->writerGUID) >= change->sequenceNumber)
Expand Down Expand Up @@ -240,9 +240,9 @@ void BaseReader::update_liveliness_changed_status(
liveliness_changed_status_.not_alive_count_change += not_alive_change;
liveliness_changed_status_.last_publication_handle = writer;

if (nullptr != mp_listener)
if (nullptr != listener_)
{
mp_listener->on_liveliness_changed(this, liveliness_changed_status_);
listener_->on_liveliness_changed(this, liveliness_changed_status_);

liveliness_changed_status_.alive_count_change = 0;
liveliness_changed_status_.not_alive_count_change = 0;
Expand Down Expand Up @@ -385,7 +385,7 @@ fastrtps::rtps::History::const_iterator BaseReader::findCacheInFragmentedProcess
fastrtps::rtps::CacheChange_t** change,
fastrtps::rtps::History::const_iterator hint) const
{
fastrtps::rtps::History::const_iterator ret_val = mp_history->get_change_nts(sequence_number, writer_guid, change, hint);
fastrtps::rtps::History::const_iterator ret_val = history_->get_change_nts(sequence_number, writer_guid, change, hint);

if (nullptr != *change && (*change)->is_fully_assembled())
{
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/rtps/reader/BaseReader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class BaseReader
void setTrustedWriter(
const fastrtps::rtps::EntityId_t& writer)
{
m_acceptMessagesFromUnkownWriters = false;
accept_messages_from_unkown_writers_ = false;
m_trustedWriterEntityId = writer;
}

Expand Down
32 changes: 16 additions & 16 deletions src/cpp/rtps/reader/RTPSReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ RTPSReader::RTPSReader(
ReaderHistory* hist,
ReaderListener* rlisten)
: Endpoint(pimpl, guid, att.endpoint)
, mp_history(hist)
, mp_listener(rlisten)
, m_acceptMessagesFromUnkownWriters(false)
, m_expectsInlineQos(att.expectsInlineQos)
, history_(hist)
, listener_(rlisten)
, accept_messages_from_unkown_writers_(false)
, expects_inline_qos_(att.expectsInlineQos)
{
PoolConfig cfg = PoolConfig::from_history_attributes(hist->m_att);
std::shared_ptr<IChangePool> change_pool;
Expand Down Expand Up @@ -82,10 +82,10 @@ RTPSReader::RTPSReader(
ReaderHistory* hist,
ReaderListener* rlisten)
: Endpoint(pimpl, guid, att.endpoint)
, mp_history(hist)
, mp_listener(rlisten)
, m_acceptMessagesFromUnkownWriters(false)
, m_expectsInlineQos(att.expectsInlineQos)
, history_(hist)
, listener_(rlisten)
, accept_messages_from_unkown_writers_(false)
, expects_inline_qos_(att.expectsInlineQos)
{
init(payload_pool, change_pool);
}
Expand All @@ -97,33 +97,33 @@ void RTPSReader::init(
payload_pool_ = payload_pool;
change_pool_ = change_pool;
fixed_payload_size_ = 0;
if (mp_history->m_att.memoryPolicy == PREALLOCATED_MEMORY_MODE)
if (history_->m_att.memoryPolicy == PREALLOCATED_MEMORY_MODE)
{
fixed_payload_size_ = mp_history->m_att.payloadMaxSize;
fixed_payload_size_ = history_->m_att.payloadMaxSize;
}

mp_history->mp_reader = this;
mp_history->mp_mutex = &mp_mutex;
history_->mp_reader = this;
history_->mp_mutex = &mp_mutex;

EPROSIMA_LOG_INFO(RTPS_READER, "RTPSReader created correctly");
}

RTPSReader::~RTPSReader()
{
mp_history->mp_reader = nullptr;
mp_history->mp_mutex = nullptr;
history_->mp_reader = nullptr;
history_->mp_mutex = nullptr;
}

ReaderListener* RTPSReader::get_listener() const
{
return mp_listener;
return listener_;
}

bool RTPSReader::set_listener(
ReaderListener* target)
{
std::lock_guard<RecursiveTimedMutex> guard(mp_mutex);
mp_listener = target;
listener_ = target;
return true;
}

Expand Down
Loading

0 comments on commit b08a8aa

Please sign in to comment.