Fast DDS  Version 3.0.1
Fast DDS
Loading...
Searching...
No Matches
ReaderListener Class Reference

Class ReaderListener, to be used by the user to override some of is virtual method to program actions to certain events. More...

#include <ReaderListener.hpp>

Public Member Functions

 ReaderListener ()=default
 
virtual ~ReaderListener ()=default
 
virtual void on_reader_matched (RTPSReader *reader, const MatchingInfo &info)
 This method is invoked when a new reader matches.
 
virtual void on_new_cache_change_added (RTPSReader *reader, const CacheChange_t *const change)
 This method is called when a new CacheChange_t is added to the ReaderHistory.
 
virtual void on_liveliness_changed (RTPSReader *reader, const eprosima::fastdds::dds::LivelinessChangedStatus &status)
 Method called when the liveliness of a reader changes.
 
virtual void on_requested_incompatible_qos (RTPSReader *reader, eprosima::fastdds::dds::PolicyMask qos)
 This method is called when a new Writer is discovered, with a Topic that matches that of a local reader, but with an offered QoS that is incompatible with the one requested by the local reader.
 
virtual void on_sample_lost (RTPSReader *reader, int32_t sample_lost_since_last_update)
 This method is called when the reader detects that one or more samples have been lost.
 
virtual void on_writer_discovery (RTPSReader *reader, WriterDiscoveryStatus reason, const GUID_t &writer_guid, const PublicationBuiltinTopicData *writer_info)
 Method called when the discovery information of a writer regarding a reader changes.
 
virtual void on_sample_rejected (RTPSReader *reader, eprosima::fastdds::dds::SampleRejectedStatusKind reason, const CacheChange_t *const change)
 This method is called when the reader rejects a samples.
 
virtual void on_data_available (RTPSReader *reader, const GUID_t &writer_guid, const SequenceNumber_t &first_sequence, const SequenceNumber_t &last_sequence, bool &should_notify_individual_changes)
 This method is called when new CacheChange_t objects are made available to the user.
 
virtual void on_incompatible_type (RTPSReader *reader)
 This method is called when a new Writer is discovered, with a Topic that matches the name of a local reader, but with an incompatible type.
 

Detailed Description

Class ReaderListener, to be used by the user to override some of is virtual method to program actions to certain events.

Constructor & Destructor Documentation

◆ ReaderListener()

ReaderListener ( )
default

◆ ~ReaderListener()

virtual ~ReaderListener ( )
virtualdefault

Member Function Documentation

◆ on_data_available()

virtual void on_data_available ( RTPSReader reader,
const GUID_t writer_guid,
const SequenceNumber_t first_sequence,
const SequenceNumber_t last_sequence,
bool &  should_notify_individual_changes 
)
inlinevirtual

This method is called when new CacheChange_t objects are made available to the user.

Note
This method is currently never called. Implementation will be added in future releases.
Parameters
[in]readerPointer to the reader performing the notification.
[in]writer_guidGUID of the writer from which the changes were received.
[in]first_sequenceSequence number of the first change made available.
[in]last_sequenceSequence number of the last change made available. It will always be greater or equal than first_sequence.
[out]should_notify_individual_changesWhether the individual changes should be notified by means of on_new_cache_change_added.

◆ on_incompatible_type()

virtual void on_incompatible_type ( RTPSReader reader)
inlinevirtual

This method is called when a new Writer is discovered, with a Topic that matches the name of a local reader, but with an incompatible type.

Parameters
readerPointer to the RTPSReader.

◆ on_liveliness_changed()

virtual void on_liveliness_changed ( RTPSReader reader,
const eprosima::fastdds::dds::LivelinessChangedStatus status 
)
inlinevirtual

Method called when the liveliness of a reader changes.

Parameters
readerThe reader
statusThe liveliness changed status

◆ on_new_cache_change_added()

virtual void on_new_cache_change_added ( RTPSReader reader,
const CacheChange_t *const  change 
)
inlinevirtual

This method is called when a new CacheChange_t is added to the ReaderHistory.

Parameters
readerPointer to the reader.
changePointer to the CacheChange_t. This is a const pointer to const data to indicate that the user should not dispose of this data himself. To remove the data call the remove_change method of the ReaderHistory. reader->get_history()->remove_change((CacheChange_t*)change).

◆ on_reader_matched()

virtual void on_reader_matched ( RTPSReader reader,
const MatchingInfo info 
)
inlinevirtual

This method is invoked when a new reader matches.

Parameters
readerMatching reader
infoMatching information of the reader

◆ on_requested_incompatible_qos()

virtual void on_requested_incompatible_qos ( RTPSReader reader,
eprosima::fastdds::dds::PolicyMask  qos 
)
inlinevirtual

This method is called when a new Writer is discovered, with a Topic that matches that of a local reader, but with an offered QoS that is incompatible with the one requested by the local reader.

Parameters
readerPointer to the RTPSReader.
qosA mask with the bits of all incompatible Qos activated.

◆ on_sample_lost()

virtual void on_sample_lost ( RTPSReader reader,
int32_t  sample_lost_since_last_update 
)
inlinevirtual

This method is called when the reader detects that one or more samples have been lost.

Parameters
readerPointer to the RTPSReader.
sample_lost_since_last_updateThe number of samples that were lost since the last time this method was called for the same reader.

◆ on_sample_rejected()

virtual void on_sample_rejected ( RTPSReader reader,
eprosima::fastdds::dds::SampleRejectedStatusKind  reason,
const CacheChange_t *const  change 
)
inlinevirtual

This method is called when the reader rejects a samples.

Parameters
readerPointer to the RTPSReader.
reasonIndicates reason for sample rejection.
changePointer to the CacheChange_t. This is a const pointer to const data to indicate that the user should not dispose of this data himself.

◆ on_writer_discovery()

virtual void on_writer_discovery ( RTPSReader reader,
WriterDiscoveryStatus  reason,
const GUID_t writer_guid,
const PublicationBuiltinTopicData writer_info 
)
inlinevirtual

Method called when the discovery information of a writer regarding a reader changes.

Parameters
readerThe reader.
reasonThe reason motivating this method to be called.
writer_guidThe GUID of the writer for which the discovery information changed.
writer_infoDiscovery information about the writer. Will be nullptr for reason REMOVED_WRITER.

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