Function dds_create_topic

Function Documentation

dds_entity_t dds_create_topic(dds_entity_t participant, const dds_topic_descriptor_t *descriptor, const char *name, const dds_qos_t *qos, const dds_listener_t *listener)

Creates a new topic with default type handling.

The type name for the topic is taken from the generated descriptor. Topic matching is done on a combination of topic name and type name. Each successful call to dds_create_topic creates a new topic entity sharing the same QoS settings with all other topics of the same name.

Parameters
  • participant[in] Participant on which to create the topic.

  • descriptor[in] An IDL generated topic descriptor.

  • name[in] Name of the topic.

  • qos[in] QoS to set on the new topic (can be NULL).

  • listener[in] Any listener functions associated with the new topic (can be NULL).

Return values
  • >=0 – A valid unique topic handle.

  • DDS_RETCODE_BAD_PARAMETER – Either participant, descriptor, name or qos is invalid.

  • DDS_RETCODE_BAD_PARAMETER – Either participant, descriptor, name or qos is invalid.

  • DDS_RETCODE_INCONSISTENT_POLICY – QoS mismatch between qos and an existing topic’s QoS.

  • DDS_RETCODE_PRECONDITION_NOT_MET – Mismatch between type name in descriptor and pre-existing topic’s type name.

Returns

A valid, unique topic handle or an error code.