Working with subscribers.
More...
Working with subscribers.
Setting up a subscriber
- Create a DDSSubscriber
new MySubscriberListener();
};
subscriber_listener,
if (subscriber == NULL) {
};
Set up subscriber to access received data
- Set up to handle the DDS_DATA_ON_READERS_STATUS status, in one or both of the following two ways.
Access received data via a subscriber
- Get the list of readers that have data samples available:
sample_state_mask,
view_state_mask,
instance_state_mask);
}
- Upon successfully getting the list of readers with data, process the data readers to either:
If the intent is to access the data coherently or in order, the list of data readers must be processed in the order returned:
for(int i = 0; i < reader_seq.length(); ++i) {
TDataReader* reader = reader_seq[i];
}
Access received data coherently and/or in order
To access the received data coherently and/or in an ordered manner, according to the settings of the DDS_PresentationQosPolicy attached to a DDSSubscriber:
- Indicate that data will be accessed via the subscriber:
- Indicate that the data access via the subscriber is done:
Tearing down a subscriber