Fast DDS  Version 3.1.0
Fast DDS
Loading...
Searching...
No Matches
RTPSReader Class Referenceabstract

Class RTPSReader, manages the reception of data from its matched writers. More...

#include <RTPSReader.hpp>

Inheritance diagram for RTPSReader:

Public Member Functions

virtual FASTDDS_EXPORTED_API bool matched_writer_add (const PublicationBuiltinTopicData &info)=0
 Add a matched writer represented by its publication info.
 
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.
 
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.
 
virtual FASTDDS_EXPORTED_API void assert_writer_liveliness (const GUID_t &writer)=0
 Assert the liveliness of a matched writer.
 
virtual FASTDDS_EXPORTED_API bool is_in_clean_state ()=0
 Check if this reader is in a clean state with all its matched writers.
 
virtual FASTDDS_EXPORTED_API ReaderListenerget_listener () const =0
 Get the associated listener.
 
virtual FASTDDS_EXPORTED_API void set_listener (ReaderListener *listener)=0
 Change the listener associated to this reader.
 
virtual FASTDDS_EXPORTED_API bool expects_inline_qos () const =0
 
virtual FASTDDS_EXPORTED_API ReaderHistoryget_history () const =0
 
virtual FASTDDS_EXPORTED_API eprosima::fastdds::rtps::IReaderDataFilterget_content_filter () const =0
 
virtual FASTDDS_EXPORTED_API void set_content_filter (eprosima::fastdds::rtps::IReaderDataFilter *filter)=0
 Set the content filter associated to this reader.
 
virtual FASTDDS_EXPORTED_API CacheChange_tnext_unread_cache ()=0
 Read the next unread CacheChange_t from the history.
 
virtual FASTDDS_EXPORTED_API CacheChange_tnext_untaken_cache ()=0
 Get the next CacheChange_t from the history to take.
 
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.
 
virtual FASTDDS_EXPORTED_API uint64_t get_unread_count () const =0
 Get 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.
 
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.
 
- Public Member Functions inherited from Endpoint
FASTDDS_EXPORTED_API const GUID_tgetGuid () const
 Get associated GUID.
 
FASTDDS_EXPORTED_API RecursiveTimedMutexgetMutex ()
 Get mutex.
 
FASTDDS_EXPORTED_API EndpointAttributesgetAttributes ()
 Get associated attributes.
 

Protected Member Functions

 RTPSReader (RTPSParticipantImpl *pimpl, const GUID_t &guid, const ReaderAttributes &att, ReaderHistory *hist)
 
 ~RTPSReader ()
 
- Protected Member Functions inherited from Endpoint
 Endpoint ()=default
 
 Endpoint (RTPSParticipantImpl *pimpl, const GUID_t &guid, const EndpointAttributes &att)
 
virtual ~Endpoint ()
 

Protected Attributes

ReaderHistoryhistory_
 ReaderHistory.
 
- Protected Attributes inherited from Endpoint
RTPSParticipantImplmp_RTPSParticipant
 Pointer to the RTPSParticipant containing this endpoint.
 
const GUID_t m_guid
 Endpoint GUID.
 
EndpointAttributes m_att
 Endpoint Attributes.
 
RecursiveTimedMutex mp_mutex
 Endpoint Mutex.
 
uint32_t fixed_payload_size_ = 0
 Fixed size of payloads.
 

Detailed Description

Class RTPSReader, manages the reception of data from its matched writers.

Needs to be constructed using the createRTPSReader method from the RTPSDomain.

Constructor & Destructor Documentation

◆ RTPSReader()

RTPSReader ( RTPSParticipantImpl pimpl,
const GUID_t guid,
const ReaderAttributes att,
ReaderHistory hist 
)
protected

◆ ~RTPSReader()

~RTPSReader ( )
protected

Member Function Documentation

◆ assert_writer_liveliness()

virtual FASTDDS_EXPORTED_API void assert_writer_liveliness ( const GUID_t writer)
pure virtual

Assert the liveliness of a matched writer.

Parameters
writerGUID of the writer on which to assert liveliness.

◆ expects_inline_qos()

virtual FASTDDS_EXPORTED_API bool expects_inline_qos ( ) const
pure virtual
Returns
True if the reader expects Inline QoS.

◆ get_content_filter()

virtual FASTDDS_EXPORTED_API eprosima::fastdds::rtps::IReaderDataFilter * get_content_filter ( ) const
pure virtual
Returns
The content filter associated to this reader.

◆ get_history()

virtual FASTDDS_EXPORTED_API ReaderHistory * get_history ( ) const
pure virtual
Returns
a pointer to the associated History.

◆ get_listener()

virtual FASTDDS_EXPORTED_API ReaderListener * get_listener ( ) const
pure virtual

Get the associated listener.

Returns
Pointer to the associated reader listener.

◆ get_unread_count() [1/2]

virtual FASTDDS_EXPORTED_API uint64_t get_unread_count ( ) const
pure virtual

Get the number of unread CacheChange_t in the history.

Returns
The number of unread CacheChange_t in the history.

◆ get_unread_count() [2/2]

virtual FASTDDS_EXPORTED_API uint64_t get_unread_count ( bool  mark_as_read)
pure virtual

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

Parameters
mark_as_readWhether to mark the unread CacheChange_t as read.
Returns
The number of previously unread CacheChange_t in the history.

◆ is_in_clean_state()

virtual FASTDDS_EXPORTED_API bool is_in_clean_state ( )
pure virtual

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.

◆ is_sample_valid()

virtual FASTDDS_EXPORTED_API bool is_sample_valid ( const void *  data,
const GUID_t writer,
const SequenceNumber_t sn 
) const
pure virtual

Checks whether the sample is still valid or is corrupted.

Parameters
dataPointer 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.
writerGUID of the writer that sent data.
snSequence number related to data.
Returns
true if the sample is valid

◆ matched_writer_add()

virtual FASTDDS_EXPORTED_API bool matched_writer_add ( const PublicationBuiltinTopicData info)
pure virtual

Add a matched writer represented by its publication info.

Parameters
infoPublication info of the writer being matched.
Returns
True if correctly added.

◆ matched_writer_is_matched()

virtual FASTDDS_EXPORTED_API bool matched_writer_is_matched ( const GUID_t writer_guid)
pure virtual

Check if a specific writer is matched against this reader.

Parameters
writer_guidGUID of the writer to check.
Returns
True if the specified writer is matched with this reader.

◆ matched_writer_remove()

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

Remove a writer from the matched writers.

Parameters
writer_guidGUID of the writer to remove.
removed_by_leaseWhether the writer is being unmatched due to a participant drop.
Returns
True if correctly removed.

◆ next_unread_cache()

virtual FASTDDS_EXPORTED_API CacheChange_t * next_unread_cache ( )
pure virtual

Read the next unread CacheChange_t from the history.

Returns
A pointer to the first unread CacheChange_t from the history.

◆ next_untaken_cache()

virtual FASTDDS_EXPORTED_API CacheChange_t * next_untaken_cache ( )
pure virtual

Get the next CacheChange_t from the history to take.

Returns
A pointer to the first CacheChange_t in the history.

◆ set_content_filter()

virtual FASTDDS_EXPORTED_API void set_content_filter ( eprosima::fastdds::rtps::IReaderDataFilter filter)
pure virtual

Set the content filter associated to this reader.

Parameters
filterPointer to the content filter to associate to this reader.

◆ set_listener()

virtual FASTDDS_EXPORTED_API void set_listener ( ReaderListener listener)
pure virtual

Change the listener associated to this reader.

Parameters
listenerThe new listener to associate to this reader.

◆ wait_for_unread_cache()

virtual FASTDDS_EXPORTED_API bool wait_for_unread_cache ( const eprosima::fastdds::dds::Duration_t timeout)
pure virtual

Wait until there is an unread CacheChange_t in the history.

Parameters
timeoutMaximum time to wait.
Returns
true if there is an unread CacheChange_t in the history.

Member Data Documentation

◆ history_

ReaderHistory* history_
protected

The documentation for this class was generated from the following file: