Class PDPListener

Inheritance Relationships

Base Type

Class Documentation

class PDPListener : public eprosima::fastrtps::rtps::ReaderListener

Class PDPListener, specification used by the PDP to perform the History check when a new message is received. This class is implemented in order to use the same structure than with any other RTPSReader.

Public Functions

PDPListener(PDP *parent)
Parameters:

parent – Pointer to object creating this object

virtual ~PDPListener() override = default
virtual void onNewCacheChangeAdded(RTPSReader *reader, const CacheChange_t *const change) override

New added cache

Parameters:
  • reader

  • change

Protected Functions

virtual void process_alive_data(ParticipantProxyData *old_data, ParticipantProxyData &new_data, GUID_t &writer_guid, RTPSReader *reader, std::unique_lock<std::recursive_mutex> &lock)

Process an incoming DATA(p). This method is called from PDPListener::onNewCacheChangeAdded() when an alive DATA(p) is received. Both the reader lock and the PDP lock are held when this method is called.

Parameters:
  • old_data – Pointer to the ParticipantProxyData currently stored in the database. May be nullptr, for a recently discovered participant.

  • new_dataParticipantProxyData from the DATA(p) message.

  • writer_guid – GUID of the writer that sent the DATA(p) message.

  • readerRTPSReader that received the DATA(p) message.

  • lock – Lock on the PDP database. Passed so it can be released before invoking callbacks.

bool get_key(CacheChange_t *change)

Get the key of a CacheChange_t

Parameters:

change – Pointer to the CacheChange_t

Returns:

True on success

Protected Attributes

PDP *parent_pdp_

Pointer to the associated mp_SPDP;.

ParticipantProxyData temp_participant_data_

Temporary data to avoid reallocations.

Remark

This should be always accessed with the pdp_reader lock taken