| Fast DDS Version 3.3.0 Fast DDS

Loading...
Searching...
No Matches
ReaderListener Class Reference
eProsima Fast DDS API Reference » RTPS » Reader Module

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 | ( |  | ) |

virtual default

## 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 )

inline virtual

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] | reader | Pointer to the reader performing the notification.
  [in] | writer_guid | GUID of the writer from which the changes were received.
  [in] | first_sequence | Sequence number of the first change made available.
  [in] | last_sequence | Sequence number of the last change made available. It will always be greater or equal than `first_sequence`.
  [out] | should_notify_individual_changes | Whether the individual changes should be notified by means of `on_new_cache_change_added`.

## ◆ on_incompatible_type()

virtual void on_incompatible_type | ( | RTPSReader * | reader | ) |

inline virtual

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

  reader | Pointer to the RTPSReader.

## ◆ on_liveliness_changed()

virtual void on_liveliness_changed | ( | RTPSReader * | reader,
|  | const eprosima::fastdds::dds::LivelinessChangedStatus & | status )

inline virtual

Method called when the liveliness of a reader changes.

Parameters

  reader | The reader
  status | The liveliness changed status

## ◆ on_new_cache_change_added()

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

inline virtual

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

Parameters

  reader | Pointer to the reader.
  change | Pointer 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 )

inline virtual

This method is invoked when a new reader matches.

Parameters

  reader | Matching reader
  info | Matching information of the reader

## ◆ on_requested_incompatible_qos()

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

inline virtual

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

  reader | Pointer to the RTPSReader.
  qos | A 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 )

inline virtual

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

Parameters

  reader | Pointer to the RTPSReader.
  sample_lost_since_last_update | The 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 )

inline virtual

This method is called when the reader rejects a samples.

Parameters

  reader | Pointer to the RTPSReader.
  reason | Indicates reason for sample rejection.
  change | Pointer 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 )

inline virtual

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

Parameters

  reader | The reader.
  reason | The reason motivating this method to be called.
  writer_guid | The GUID of the writer for which the discovery information changed.
  writer_info | Discovery information about the writer. Will be `nullptr` for reason `REMOVED_WRITER`.

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

- include/fastdds/rtps/reader/ReaderListener.hpp