OpenSplice C# API  v6.x
OpenSplice C# Data Distribution Service Data-Centric Publish-Subscribe API
DDS.IDataReaderListener Interface Reference

Since a IDataReader is an Entity, it has the ability to have a IListener associated with it. In this case, the associated IListener should be of type IDataReaderListener. This interface must be implemented by the application. A user-defined class must be provided by the application which must extend from the IDataReaderListener class. More...

Inheritance diagram for DDS.IDataReaderListener:
Inheritance graph
Collaboration diagram for DDS.IDataReaderListener:
Collaboration graph

Public Member Functions

void OnDataAvailable (IDataReader entityInterface)
 This operation is called by the Data Distribution Service when new data is available for this IDataReader. More...
 
void OnLivelinessChanged (IDataReader entityInterface, LivelinessChangedStatus status)
 This operation is called by the Data Distribution Service when the liveliness of one or more IDataWriter objects that were writing instances read through this IDataReader has changed. More...
 
void OnRequestedDeadlineMissed (IDataReader entityInterface, RequestedDeadlineMissedStatus status)
 This operation called by the Data Distribution Service when the deadline that the IDataReader was expecting through its DeadlineQosPolicy was not respected for a specific instance. More...
 
void OnRequestedIncompatibleQos (IDataReader entityInterface, RequestedIncompatibleQosStatus status)
 This operation is called by the Data Distribution Service when the DDS.StatusKind.RequestedIncompatibleQos changes. More...
 
void OnSampleLost (IDataReader entityInterface, SampleLostStatus status)
 NOTE: This operation is not yet implemented. It is scheduled for a future release. More...
 
void OnSampleRejected (IDataReader entityInterface, SampleRejectedStatus status)
 This operation called by the Data Distribution Service when a (received) sample has been rejected. More...
 
void OnSubscriptionMatched (IDataReader entityInterface, SubscriptionMatchedStatus status)
 This operation is called by the Data Distribution Service when a new match has been discovered for the current subscription, or when an existing match has ceased to exist. More...
 

Detailed Description

Since a IDataReader is an Entity, it has the ability to have a IListener associated with it. In this case, the associated IListener should be of type IDataReaderListener. This interface must be implemented by the application. A user-defined class must be provided by the application which must extend from the IDataReaderListener class.

All operations for this interface must be implemented in the user-defined class, it is up to the application whether an operation is empty or contains some functionality. The IDataReaderListener provides a generic mechanism (actually a callback function) for the Data Distribution Service to notify the application of relevant asynchronous status change events, such as a missed deadline, violation of a QosPolicy setting, etc. The IDataReaderListener is related to changes in communication status IStatusConditions.

public class MyExampleDataReaderListener : DDS.IDataReaderListener
{
public MyExampleDataReaderListener()
{
}
{
Console.WriteLine("OnRequestedDeadlineMissed");
}
{
Console.WriteLine("OnRequestedIncompatibleQos");
}
{
Console.WriteLine("OnSampleRejected");
}
{
Console.WriteLine("OnLivelinessChanged");
}
public void OnDataAvailable(DDS.IDataReader reader)
{
Console.WriteLine("OnDataAvailableCalled");
}
{
Console.WriteLine("OnSubscriptionMatchCalled");
}
public void OnSampleLost(DDS.IDataReader reader, DDS.SampleLostStatus status)
{
Console.WriteLine("OnSampleLostCalled");
}
}

Definition at line 6151 of file DdsDcpsInterfaces.cs.

Member Function Documentation

◆ OnDataAvailable()

void DDS.IDataReaderListener.OnDataAvailable ( IDataReader  entityInterface)

This operation is called by the Data Distribution Service when new data is available for this IDataReader.

The implementation may be left empty when this functionality is not needed. This operation will only be called when the relevant IDataReaderListener is installed and enabled for the DDS.StatusKind.DataAvailable. The Data Distribution Service will provide a reference to the IDataReader in the parameter entityInterface for use by the application. The statuses DDS.StatusKind.DataOnReaders and DDS.StatusKind.DataAvailable will occur together. In case these status changes occur, the Data Distribution Service will look for an attached and activated ISubscriberListener or IDomainParticipantListener (in that order) for the enabled DDS.StatusKind.DataOnReaders. In case the DDS.StatusKind.DataOnReaders can not be handled, the Data Distribution Service will look for an attached and activated IDataReaderListener, ISubscriberListener or IDomainParticipantListener for the enabled DDS.StatusKind.DataAvailable (in that order). Note that if DataOnReaders is called, then the Data Distribution Service will not try to call DataAvailable, however, the application can force a call to the IDataReader objects that have data by means of the ISubscriber.NotifyDataReaders operation.

Parameters
entityInterfacecontain a pointer to the IDataReader for which data is available (this is an input to the application provided by the Data Distribution Service).

◆ OnLivelinessChanged()

void DDS.IDataReaderListener.OnLivelinessChanged ( IDataReader  entityInterface,
LivelinessChangedStatus  status 
)

This operation is called by the Data Distribution Service when the liveliness of one or more IDataWriter objects that were writing instances read through this IDataReader has changed.

In other words, some IDataWriter have become “alive” or “not alive”. The implementation may be left empty when this functionality is not needed. This operation will only be called when the relevant IDataReaderListener is installed and enabled for the DDS.StatusKind.LivelinessChanged.

Parameters
entityInterfacecontain a pointer to the IDataReader for which the liveliness of one or more IDataWriter objects has changed (this is an input to the application provided by the Data Distribution Service).
statuscontain the LivelinessChangedStatus object (this is an input to the application provided by the Data Distribution Service).

◆ OnRequestedDeadlineMissed()

void DDS.IDataReaderListener.OnRequestedDeadlineMissed ( IDataReader  entityInterface,
RequestedDeadlineMissedStatus  status 
)

This operation called by the Data Distribution Service when the deadline that the IDataReader was expecting through its DeadlineQosPolicy was not respected for a specific instance.

The implementation may be left empty when this functionality is not needed. This operation will only be called when the relevant IDataReaderListener is installed and enabled for the DDS.StatusKind.RequestedDeadlineMissed

Parameters
entityInterfacecontain a pointer to the IDataReader for which the deadline was missed (this is an input to the application provided by the Data Distribution Service).
statuscontain the RequestedDeadlineMissedStatus object (this is an input to the application provided by the Data Distribution Service).

◆ OnRequestedIncompatibleQos()

void DDS.IDataReaderListener.OnRequestedIncompatibleQos ( IDataReader  entityInterface,
RequestedIncompatibleQosStatus  status 
)

This operation is called by the Data Distribution Service when the DDS.StatusKind.RequestedIncompatibleQos changes.

The implementation may be left empty when this functionality is not needed. This operation will only be called when the relevant IDataReaderListener is installed and enabled for the DDS.StatusKind.RequestedIncompatibleQos. The Data Distribution Service will provide a reference to the IDataReader in the parameter entityInterface and the RequestedIncompatibleQosStatus object in the parameter status , for use by the application.

When the IDataReaderListener on the IDataReader is not enabled with the DDS.StatusKind.RequestedIncompatibleQos, the DDS.StatusKind.RequestedIncompatibleQos change will propagate to the ISubscriberListener of the ISubscriber (if enabled) or to the IDomainParticipantListener of the IDomainParticipant (if enabled).

Parameters
entityInterfacereader the IDataReader provided by the Data Distribution Service.
statusthe RequestedIncompatibleQosStatus object provided by the Data Distribution Service.

◆ OnSampleLost()

void DDS.IDataReaderListener.OnSampleLost ( IDataReader  entityInterface,
SampleLostStatus  status 
)

NOTE: This operation is not yet implemented. It is scheduled for a future release.

Parameters
entityInterfacethe IDataReader the Listener is applied to
statusthe SampleLostStatus status

◆ OnSampleRejected()

void DDS.IDataReaderListener.OnSampleRejected ( IDataReader  entityInterface,
SampleRejectedStatus  status 
)

This operation called by the Data Distribution Service when a (received) sample has been rejected.

Samples may be rejected by the IDataReader when it runs out of ResourceLimitsQosPolicy to store incoming samples. Usually this means that old samples need to be ‘consumed’ (for example by ‘taking’ them instead of ‘reading’ them) to make room for newly incoming samples. The implementation may be left empty when this functionality is not needed. This operation will only be called when the relevant IDataReaderListener is installed and enabled with the DDS.StatusKind.SampleLost.

Parameters
entityInterfacecontains a pointer to the IDataReader for which a sample has been rejected (this is an input to the application provided by the Data Distribution Service).
statuscontains the SampleRejectedStatus object (this is an input to the application provided by the Data Distribution Service).

◆ OnSubscriptionMatched()

void DDS.IDataReaderListener.OnSubscriptionMatched ( IDataReader  entityInterface,
SubscriptionMatchedStatus  status 
)

This operation is called by the Data Distribution Service when a new match has been discovered for the current subscription, or when an existing match has ceased to exist.

Usually this means that a new IDataWriter that matches the ITopic and that has compatible Qos as the current IDataReader has either been discovered, or that a previously discovered IDataWriter has ceased to be matched to the current IDataReader. A IDataWriter may cease to match when it gets deleted, when it changes its Qos to a value that is incompatible with the current IDataReader or when either the IDataReader or the IDataWriter has chosen to put its matching counterpart on its ignore-list using the DDS.IDomainParticipant.IgnoreSubscription or DDS.IDomainParticipant.IgnorePublication operations.

The implementation of this IListener operation may be left empty when this functionality is not needed: it will only be called when the relevant IDataReaderListener is installed and enabled for the DDS.StatusKind.SubscriptionMatched.

Parameters
entityInterfacecontains a pointer to the IDataReader for which a match has been discovered (this is an input to the application provided by the Data Distribution Service).
statuscontains the SubscriptionMatchedStatus object (this is an input to the application provided by the Data Distribution Service).

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