builtin¶
- class cyclonedds.builtin.BuiltinDataReader(subscriber_or_participant, builtin_topic, qos=None, listener=None)[source]¶
Bases:
cyclonedds.sub.DataReader
Builtin topics have sligtly different behaviour than normal topics, so you should use this BuiltinDataReader instead of the normal DataReader. They are identical in the rest of their functionality.
- Parameters
subscriber_or_participant (Union[cyclonedds.sub.Subscriber, cyclonedds.domain.DomainParticipant]) –
builtin_topic (cyclonedds.builtin.BuiltinTopic) –
qos (Optional[cyclonedds.core.Qos]) –
listener (Optional[cyclonedds.core.Listener]) –
- Return type
None
- __init__(subscriber_or_participant, builtin_topic, qos=None, listener=None)[source]¶
Initialize the BuiltinDataReader
- Parameters
subscriber_or_participant (cyclonedds.sub.Subscriber, cyclonedds.domain.DomainParticipant) – The subscriber to which this reader will be added. If you supply a DomainParticipant a subscriber will be created for you.
builtin_topic (cyclonedds.builtin.BuiltinTopic) – Which Builtin Topic to subscribe to. This can be one of BuiltinTopicDcpsParticipant, BuiltinTopicDcpsTopic, BuiltinTopicDcpsPublication or BuiltinTopicDcpsSubscription. Please note that BuiltinTopicDcpsTopic will fail if you built CycloneDDS without Topic Discovery.
qos (cyclonedds.core.Qos, optional = None) – Optionally supply a Qos.
listener (cyclonedds.core.Listener = None) – Optionally supply a Listener.
- Return type
None
- read(N=1, condition=None)[source]¶
Read a maximum of N samples, non-blocking. Optionally use a read/query-condition to select which samples you are interested in.
- Parameters
N (int) – The maximum number of samples to read.
condition (cyclonedds.core.ReadCondition, cyclonedds.core.QueryCondition, optional) – Only read samples that satisfy the supplied condition.
- Raises
DDSException – If any error code is returned by the DDS API it is converted into an exception.
- take(N=1, condition=None)[source]¶
Take a maximum of N samples, non-blocking. Optionally use a read/query-condition to select which samples you are interested in.
- Parameters
N (int) – The maximum number of samples to read.
condition (cyclonedds.core.ReadCondition, cyclonedds.core.QueryCondition, optional) – Only take samples that satisfy the supplied condition.
- Raises
DDSException – If any error code is returned by the DDS API it is converted into an exception.
- class cyclonedds.builtin.DcpsParticipant(key, qos)[source]¶
Data sample as returned when you subscribe to the BuiltinTopicDcpsParticipant topic.
- Parameters
key (uuid.UUID) –
qos (cyclonedds.qos.Qos) –
- Return type
None
- class cyclonedds.builtin.DcpsEndpoint(key, participant_key, participant_instance_handle, topic_name, type_name, qos, type_id)[source]¶
Data sample as returned when you subscribe to the BuiltinTopicDcpsPublication or BuiltinTopicDcpsSubscription topic.
- Parameters
- Return type
None
- typeid¶
Complete XTypes TypeIdentifier of the type, can be None.
- Type
TypeIdentifier, optional
- class cyclonedds.builtin.BuiltinTopic(_ref, data_type)[source]¶
Bases:
cyclonedds.topic.Topic
Represent a built-in CycloneDDS Topic by magic reference number.
- cyclonedds.builtin.BuiltinTopicDcpsParticipant¶
Built-in topic, is published to when a new participants appear on the network.
- cyclonedds.builtin.BuiltinTopicDcpsTopic¶
Built-in topic, is published to when a new topic appear on the network.
Make sure cyclonedds has been built with -DENABLE_TOPIC_DISCOVERY=ON and //CycloneDDS/Domain/Discovery/EnableTopicDiscoveryEndpoints is set in the config.
- cyclonedds.builtin.BuiltinTopicDcpsPublication¶
Built-in topic, is published to when a publication happens.
- cyclonedds.builtin.BuiltinTopicDcpsSubscription¶
Built-in topic, is published to when a subscription happens.