RTI Connext Modern C++ API  Version 6.1.0
rti::queuing::QueueConsumerListener< T > Class Template Referenceabstract

Called when certain events occur in a QueueConsumer. More...

#include <rti/queuing/QueueConsumerListener.hpp>

Inheritance diagram for rti::queuing::QueueConsumerListener< T >:
rti::queuing::NoOpQueueConsumerListener< T >

Public Member Functions

virtual void on_sample_available (QueueConsumer< T > &consumer)=0
 User callback. More...
 
virtual void on_shared_reader_queue_matched (QueueConsumer< T > &consumer, const dds::core::status::SubscriptionMatchedStatus &status)=0
 User callback. More...
 

Detailed Description

template<typename T>
class rti::queuing::QueueConsumerListener< T >

Called when certain events occur in a QueueConsumer.

A QueueConsumer listener is a way to implement a callback that will be invoked when certain events happen. It is an optional parameter in QueueConsumerParams.

You can use this listener to receive notification when:

  • Samples are available
  • There are SharedReaderQueue matching events
See also
QueueConsumer::QueueConsumer()

Member Function Documentation

◆ on_sample_available()

template<typename T>
virtual void rti::queuing::QueueConsumerListener< T >::on_sample_available ( QueueConsumer< T > &  consumer)
pure virtual

User callback.

This callback is invoked whenever the QueueConsumer has received at least one sample. Any operation to get samples i.e. QueueConsumer::take_sample) can be called within this context.

See also
dds::sub::DataReaderListener::on_data_available

Implemented in rti::queuing::NoOpQueueConsumerListener< T >, rti::queuing::NoOpQueueConsumerListener< TReq >, and rti::queuing::NoOpQueueConsumerListener< TRep >.

Referenced by rti::queuing::QueueConsumer< TRep >::has_matching_reader_queue().

◆ on_shared_reader_queue_matched()

template<typename T>
virtual void rti::queuing::QueueConsumerListener< T >::on_shared_reader_queue_matched ( QueueConsumer< T > &  consumer,
const dds::core::status::SubscriptionMatchedStatus status 
)
pure virtual

User callback.

This callback is invoked whenever a new SharedReaderQueue hosted by Queuing Service has matched the QueueConsumer, or if an existing matching SharedReaderQueue is disposed.

See also
dds::core::status::SubscriptionMatchedStatus
dds::sub::DataReaderListener::on_subscription_matched

Implemented in rti::queuing::NoOpQueueConsumerListener< T >, rti::queuing::NoOpQueueConsumerListener< TReq >, and rti::queuing::NoOpQueueConsumerListener< TRep >.

Referenced by rti::queuing::QueueConsumer< TRep >::has_matching_reader_queue().