Function dds_create_readcondition

Function Documentation

dds_entity_t dds_create_readcondition(dds_entity_t reader, uint32_t mask)

Creates a readcondition associated to the given reader.

The readcondition allows specifying which samples are of interest in a data reader’s history, by means of a mask. The mask is or’d with the flags that are dds_sample_state_t, dds_view_state_t and dds_instance_state_t.

Based on the mask value set, the readcondition gets triggered when data is available on the reader.

Waitsets allow waiting for an event on some of any set of entities. This means that the readcondition can be used to wake up a waitset when data is in the reader history with states that matches the given mask.

Note

The parent reader and every of its associated conditions (whether they are readconditions or queryconditions) share the same resources. This means that one of these entities reads or takes data, the states of the data will change for other entities automatically. For instance, if one reads a sample, then the sample state will become ‘read’ for all associated reader/conditions. Or if one takes a sample, then it’s not available to any other associated reader/condition.

Parameters
  • reader[in] Reader to associate the condition to.

  • mask[in] Interest (dds_sample_state_t|dds_view_state_t|dds_instance_state_t).

Return values
  • >0 – A valid condition handle

  • DDS_RETCODE_ERROR – An internal error has occurred.

  • DDS_RETCODE_ILLEGAL_OPERATION – The operation is invoked on an inappropriate object.

  • DDS_RETCODE_ALREADY_DELETED – The entity has already been deleted.

Returns

A valid condition handle or an error code.