Function dds_create_querycondition

Function Documentation

dds_entity_t dds_create_querycondition(dds_entity_t reader, uint32_t mask, dds_querycondition_filter_fn filter)

Creates a queryondition associated to the given reader.

The queryondition allows specifying which samples are of interest in a data reader’s history, by means of a mask and a filter. 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 and data that matches the filter, the querycondition 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 querycondition can be used to wake up a waitset when data is in the reader history with states that matches the given mask and filter.

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

  • filter[in] Callback that the application can use to filter specific samples.

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