Class RTPSReader

Inheritance Relationships

Base Type

Class Documentation

class RTPSReader : public eprosima::fastdds::rtps::Endpoint

Class RTPSReader, manages the reception of data from its matched writers. Needs to be constructed using the createRTPSReader method from the RTPSDomain.

Public Functions

virtual FASTDDS_EXPORTED_API bool matched_writer_add (const PublicationBuiltinTopicData &info)=0

Add a matched writer represented by its publication info.

Parameters:

info – Publication info of the writer being matched.

Returns:

True if correctly added.

virtual FASTDDS_EXPORTED_API bool matched_writer_remove (const GUID_t &writer_guid, bool removed_by_lease=false)=0

Remove a writer from the matched writers.

Parameters:
  • writer_guid – GUID of the writer to remove.

  • removed_by_lease – Whether the writer is being unmatched due to a participant drop.

Returns:

True if correctly removed.

virtual FASTDDS_EXPORTED_API bool matched_writer_is_matched (const GUID_t &writer_guid)=0

Check if a specific writer is matched against this reader.

Parameters:

writer_guid – GUID of the writer to check.

Returns:

True if the specified writer is matched with this reader.

virtual FASTDDS_EXPORTED_API void assert_writer_liveliness (const GUID_t &writer)=0

Assert the liveliness of a matched writer.

Parameters:

writer – GUID of the writer on which to assert liveliness.

virtual FASTDDS_EXPORTED_API bool is_in_clean_state ()=0

Check if this reader is in a clean state with all its matched writers. This will happen when the reader has received all samples announced by all its matched writers.

Returns:

Whether the reader is in a clean state with all its matched writers.

virtual FASTDDS_EXPORTED_API ReaderListener * get_listener () const =0

Get the associated listener.

Returns:

Pointer to the associated reader listener.

virtual FASTDDS_EXPORTED_API void set_listener (ReaderListener *listener)=0

Change the listener associated to this reader.

Parameters:

listener – The new listener to associate to this reader.

virtual FASTDDS_EXPORTED_API bool expects_inline_qos () const =0
Returns:

True if the reader expects Inline QoS.

virtual FASTDDS_EXPORTED_API ReaderHistory * get_history () const =0
Returns:

a pointer to the associated History.

virtual FASTDDS_EXPORTED_API eprosima::fastdds::rtps::IReaderDataFilter * get_content_filter () const =0
Returns:

The content filter associated to this reader.

virtual FASTDDS_EXPORTED_API void set_content_filter (eprosima::fastdds::rtps::IReaderDataFilter *filter)=0

Set the content filter associated to this reader.

Parameters:

filter – Pointer to the content filter to associate to this reader.

virtual FASTDDS_EXPORTED_API bool matched_writers_guids (std::vector< GUID_t > &guids) const =0

Fills the provided vector with the GUIDs of the matched writers.

Parameters:

guids[out] Vector to be filled with the GUIDs of the matched writers.

Returns:

True if the operation was successful.

virtual FASTDDS_EXPORTED_API CacheChange_t * next_unread_cache ()=0

Read the next unread CacheChange_t from the history.

Returns:

A pointer to the first unread CacheChange_t from the history.

virtual FASTDDS_EXPORTED_API CacheChange_t * next_untaken_cache ()=0

Get the next CacheChange_t from the history to take.

Returns:

A pointer to the first CacheChange_t in the history.

virtual FASTDDS_EXPORTED_API bool wait_for_unread_cache (const eprosima::fastdds::dds::Duration_t &timeout)=0

Wait until there is an unread CacheChange_t in the history.

Parameters:

timeout – Maximum time to wait.

Returns:

true if there is an unread CacheChange_t in the history.

virtual FASTDDS_EXPORTED_API uint64_t get_unread_count () const =0

Get the number of unread CacheChange_t in the history.

Returns:

The number of unread CacheChange_t in the history.

virtual FASTDDS_EXPORTED_API uint64_t get_unread_count (bool mark_as_read)=0

Get the number of unread CacheChange_t in the history and optionally mark them as read.

Parameters:

mark_as_read – Whether to mark the unread CacheChange_t as read.

Returns:

The number of previously unread CacheChange_t in the history.

virtual FASTDDS_EXPORTED_API bool is_sample_valid (const void *data, const GUID_t &writer, const SequenceNumber_t &sn) const =0

Checks whether the sample is still valid or is corrupted.

Parameters:
  • data – Pointer to the sample data to check. If it does not belong to the payload pool passed to the reader on construction, it yields undefined behavior.

  • writer – GUID of the writer that sent data.

  • sn – Sequence number related to data.

Returns:

true if the sample is valid

Protected Functions

RTPSReader(RTPSParticipantImpl *pimpl, const GUID_t &guid, const ReaderAttributes &att, ReaderHistory *hist)
~RTPSReader()

Protected Attributes

ReaderHistory *history_

ReaderHistory.