RTI Connext DDS Micro C++ API
Version 2.4.14
|
<<interface>> <<cert>> Container for all DDSDomainEntity objects. More...
#include <dds_cpp_domain.hxx>
Public Member Functions | |
virtual DDSEntity * | as_entity ()=0 |
<<cert>> Access a DDSDomainParticipant's supertype instance. | |
virtual DDSPublisher * | create_publisher (const DDS_PublisherQos &qos, DDSPublisherListener *listener, DDS_StatusMask mask)=0 |
<<cert>> Creates a DDSPublisher with the desired QoS policies and attaches to it the specified DDSPublisherListener. | |
virtual DDS_ReturnCode_t | delete_publisher (DDSPublisher *p)=0 |
Deletes an existing DDSPublisher. | |
virtual DDSSubscriber * | create_subscriber (const DDS_SubscriberQos &qos, DDSSubscriberListener *listener, DDS_StatusMask mask)=0 |
<<cert>> Creates a DDSSubscriber with the desired QoS policies and attaches to it the specified DDSSubscriberListener. | |
virtual DDS_ReturnCode_t | delete_subscriber (DDSSubscriber *s)=0 |
Deletes an existing DDSSubscriber. | |
virtual DDSTopic * | create_topic (const char *topic_name, const char *type_name, const DDS_TopicQos &qos, DDSTopicListener *listener, DDS_StatusMask mask)=0 |
<<cert>> Creates a DDSTopic with the desired QoS policies | |
virtual DDS_ReturnCode_t | delete_topic (DDSTopic *topic)=0 |
Deletes a DDSTopic. | |
virtual DDSTopic * | find_topic (const char *topic_name, const DDS_Duration_t &timeout)=0 |
Finds an existing (or ready to exist) DDSTopic, based on its name. | |
virtual DDS_ReturnCode_t | get_qos (DDS_DomainParticipantQos &qos)=0 |
Get the participant QoS. | |
virtual DDS_ReturnCode_t | set_qos (const DDS_DomainParticipantQos &qos)=0 |
Change the QoS of this domain participant. | |
virtual DDS_ReturnCode_t | get_default_publisher_qos (DDS_PublisherQos &qos)=0 |
Copy the default DDS_PublisherQos values into the provided DDS_PublisherQos instance. | |
virtual DDS_ReturnCode_t | set_default_publisher_qos (const DDS_PublisherQos &qos)=0 |
Set the default DDS_PublisherQos values for this domain participant. | |
virtual DDS_ReturnCode_t | get_default_subscriber_qos (DDS_SubscriberQos &qos)=0 |
Copy the default DDS_SubscriberQos values into the provided DDS_SubscriberQos instance. | |
virtual DDS_ReturnCode_t | set_default_subscriber_qos (const DDS_SubscriberQos &qos)=0 |
Set the default DDS_SubscriberQos values for this domain participant. | |
virtual DDS_ReturnCode_t | get_default_topic_qos (DDS_TopicQos &qos)=0 |
Copies the default DDS_TopicQos values for this domain participant into the given DDS_TopicQos instance. | |
virtual DDS_ReturnCode_t | set_default_topic_qos (const DDS_TopicQos &qos)=0 |
Set the default DDS_TopicQos values for this domain participant. | |
virtual DDSTopicDescription * | lookup_topicdescription (const char *topic_name)=0 |
<<cert>> Lookup an existing locally-created DDSTopicDescription, based on its name. | |
virtual DDS_ReturnCode_t | delete_contained_entities ()=0 |
Delete all the entities that were created by means of the "create" operations on the DDSDomainParticipant. | |
virtual DDS_ReturnCode_t | register_type (const char *type_name, NDDS_Type_Plugin *plugin)=0 |
<<eXtension>> <<cert>> Allows an application to communicate to RTI Connext DDS Micro the existence of a data type. | |
virtual NDDS_Type_Plugin * | unregister_type (const char *type_name)=0 |
Allows an application to unregister a data type from RTI Connext DDS Micro. After calling unregister_type, no further communication using that type is possible. | |
virtual DDS_ReturnCode_t | set_listener (const DDSDomainParticipantListener *listener, DDS_StatusMask mask)=0 |
Sets the participant listener. | |
virtual DDSDomainParticipantListener * | get_listener ()=0 |
Get the participant listener. | |
virtual DDS_ReturnCode_t | get_current_time (DDS_Time_t ¤t_time)=0 |
<<cert>> Returns the current value of the time. | |
virtual DDS_ReturnCode_t | add_peer (const char *peer)=0 |
<<eXtension>> <<cert>> Attempt to contact one or more additional peer participants. | |
Public Member Functions inherited from DDSEntity | |
DDS_ReturnCode_t | enable () |
<<cert>> Enables the DDSEntity. | |
DDSStatusCondition * | get_statuscondition () |
<<cert>> Return the DDSStatusCondition associated with a particular DDSEntity. | |
DDS_StatusMask | get_status_changes () |
<<cert>> Retrieves the list of communication statuses in the DDSEntity that are triggered. | |
DDS_InstanceHandle_t | get_instance_handle () |
<<cert>> Allows access to the DDS_InstanceHandle_t associated with the DDSEntity. |
<<interface>> <<cert>> Container for all DDSDomainEntity objects.
The DomainParticipant object plays several roles:
- It acts as a container for all other DDSEntity objects.
- It acts as factory for the DDSPublisher, DDSSubscriber, DDSTopic and DDSEntity objects.
- It represents the participation of the application on a communication plane that isolates applications running on the same set of physical computers from each other. A domain establishes a virtual network linking all applications that share the same domainId
and isolating them from applications running on different domains. In this way, several independent distributed applications can coexist in the same physical network without interfering, or even being aware of each other.
The following operations may be called even if the DDSDomainParticipant is not enabled. Other operations will fail with the value DDS_RETCODE_NOT_ENABLED if called on a disabled DomainParticipant:
|
pure virtual |
<<cert>> Access a DDSDomainParticipant's supertype instance.
|
pure virtual |
<<cert>> Creates a DDSPublisher with the desired QoS policies and attaches to it the specified DDSPublisherListener.
qos | <<in>> QoS to be used for creating the new DDSPublisher. The special value DDS_PUBLISHER_QOS_DEFAULT can be used to indicate that the DDSPublisher should be created with the default DDS_PublisherQos set in the DDSDomainParticipant. |
listener | <<in>>. Listener to be attached to the newly created DDSPublisher. |
mask | <<in>>. Changes of communication status to be invoked on the listener. |
|
pure virtual |
Deletes an existing DDSPublisher.
p | <<in>> DDSPublisher to be deleted. |
|
pure virtual |
<<cert>> Creates a DDSSubscriber with the desired QoS policies and attaches to it the specified DDSSubscriberListener.
qos
, it is not safe to create the publisher while another thread may be simultaneously calling DDSDomainParticipant::set_default_subscriber_qos. qos | <<in>> QoS to be used for creating the new DDSSubscriber. The special value DDS_SUBSCRIBER_QOS_DEFAULT can be used to indicate that the DDSSubscriber should be created with the default DDS_SubscriberQos set in the DDSDomainParticipant. |
listener | <<in>>. Listener to be attached to the newly created DDSSubscriber. |
mask | <<in>>. Changes of communication status to be invoked on the listener. |
|
pure virtual |
Deletes an existing DDSSubscriber.
s | <<in>> DDSSubscriber to be deleted. |
|
pure virtual |
<<cert>> Creates a DDSTopic with the desired QoS policies
topic_name
attached to the same DDSDomainParticipant. If the application attempts this, this method will fail and return a NULL topic. qos
, it is not safe create the publisher while another thread may be simultaneously calling DDSDomainParticipant::set_default_topic_qos. topic_name | <<in>> Name for the new topic, must not exceed 255 characters. Cannot be NULL. |
type_name | <<in>> The type to which the new DDSTopic will be bound. Cannot be NULL. |
qos | <<in>> QoS to be used for creating the new DDSTopic. The special value DDS_TOPIC_QOS_DEFAULT can be used to indicate that the DDSTopic should be created with the default DDS_TopicQos set in the DDSDomainParticipant. |
listener | <<in>>. Listener to be attached to the newly created DDSTopic. |
mask | <<in>>. Changes of communication status to be invoked on the listener. |
|
pure virtual |
Deletes a DDSTopic.
|
pure virtual |
Finds an existing (or ready to exist) DDSTopic, based on its name.
If a DDSTopic of the same name already exists, it gives access to it, otherwise it waits until either another mechanism creates it, or else completes when the specified timeout
occurs.
DDSTopic obtained by DDSDomainParticipant::find_topic must also be deleted by means of DDSDomainParticipant::delete_topic. If DDSTopic is obtained multiple times by means of DDSDomainParticipant::find_topic or DDSDomainParticipant::create_topic, it must also be deleted that same number of times using DDSDomainParticipant::delete_topic
topic_name | <<in>> Name of the DDSTopic to search for. Cannot be NULL. |
timeout | <<in>> The time to wait if the DDSTopic doesn't exist already. |
|
pure virtual |
Get the participant QoS.
This method may potentially allocate memory depending on the sequences contained in some QoS policies.
qos | <<inout>> QoS to be filled up. |
|
pure virtual |
Change the QoS of this domain participant.
The DDS_DomainParticipantQos::entity_factory can be changed. The other policies are immutable.
qos | <<in>> Set of policies to be applied to DDSDomainParticipant. Policies must be consistent. Immutable policies cannot be changed after DDSDomainParticipant is enabled. The special value DDS_PARTICIPANT_QOS_DEFAULT can be used to indicate that the QoS of the DDSDomainParticipant should be changed to match the current default DDS_DomainParticipantQos set in the DDSDomainParticipantFactory. |
|
pure virtual |
Copy the default DDS_PublisherQos values into the provided DDS_PublisherQos instance.
The retrieved qos
will match the set of values specified on the last successful call to DDSDomainParticipant::set_default_publisher_qos, or else, if the call was never made, the default values listed in DDS_PublisherQos.
This method may potentially allocate memory depending on the sequences contained in some QoS policies.
If DDS_PUBLISHER_QOS_DEFAULT is specified as the qos
parameter when DDSDomainParticipant::create_topic is called, the default value of the QoS set in the factory, equivalent to the value obtained by calling DDSDomainParticipant::get_default_publisher_qos, will be used to create the DDSPublisher.
qos | <<inout>> Qos to be filled up. |
|
pure virtual |
Set the default DDS_PublisherQos values for this domain participant.
This default value will be used for newly created DDSPublisher if DDS_PUBLISHER_QOS_DEFAULT is specified as the qos
parameter when DDSDomainParticipant::create_publisher is called.
qos
parameter. qos | <<in>> Default qos to be set. The special value DDS_PUBLISHER_QOS_DEFAULT may be passed as qos to indicate that the default QoS should be reset back to the initial values the factory would used if DDSDomainParticipant::set_default_publisher_qos had never been called. |
|
pure virtual |
Copy the default DDS_SubscriberQos values into the provided DDS_SubscriberQos instance.
The retrieved qos
will match the set of values specified on the last successful call to DDSDomainParticipant::set_default_subscriber_qos, or else, if the call was never made, the default values listed in DDS_SubscriberQos.
This method may potentially allocate memory depending on the sequences contained in some QoS policies.
If DDS_SUBSCRIBER_QOS_DEFAULT is specified as the qos
parameter when DDSDomainParticipant::create_subscriber is called, the default value of the QoS set in the factory, equivalent to the value obtained by calling DDSDomainParticipant::get_default_subscriber_qos, will be used to create the DDSSubscriber.
qos | <<inout>> Qos to be filled up. |
|
pure virtual |
Set the default DDS_SubscriberQos values for this domain participant.
This default value will be used for newly created DDSSubscriber if DDS_SUBSCRIBER_QOS_DEFAULT is specified as the qos
parameter when DDSDomainParticipant::create_subscriber is called.
qos
parameter. qos | <<in>> Default qos to be set. The special value DDS_SUBSCRIBER_QOS_DEFAULT may be passed as qos to indicate that the default QoS should be reset back to the initial values the factory would used if DDSDomainParticipant::set_default_subscriber_qos had never been called. |
|
pure virtual |
Copies the default DDS_TopicQos values for this domain participant into the given DDS_TopicQos instance.
The retrieved qos
will match the set of values specified on the last successful call to DDSDomainParticipant::set_default_topic_qos, or else, if the call was never made, the default values listed in DDS_TopicQos.
This method may potentially allocate memory depending on the sequences contained in some QoS policies.
qos
parameter. qos | <<in>> Default qos to be retrieved. |
|
pure virtual |
Set the default DDS_TopicQos values for this domain participant.
This default value will be used for newly created DDSTopic if DDS_TOPIC_QOS_DEFAULT is specified as the qos
parameter when DDSDomainParticipant::create_topic is called.
qos
parameter. qos | <<in>> Default qos to be set. The special value DDS_TOPIC_QOS_DEFAULT may be passed as qos to indicate that the default QoS should be reset back to the initial values the factory would have used if DDSDomainParticipant::set_default_topic_qos had never been called. |
|
pure virtual |
<<cert>> Lookup an existing locally-created DDSTopicDescription, based on its name.
The returned topic can either be enabled or disabled.
The operation DDSDomainParticipant::lookup_topicdescription searches among the locally created topics and returns a pointer to a DDSTopicDescription. It is possible to delete the DDSTopicDescription returned by DDSDomainParticipant::lookup_topicdescription, provided it has no readers or writers, but then it is really deleted and subsequent lookups will fail.
topic_name | <<in>> Name of DDSTopicDescription to search for. This string must be no more than 255 characters. Cannot be NULL. |
|
pure virtual |
Delete all the entities that were created by means of the "create" operations on the DDSDomainParticipant.
This operation deletes all contained DDSPublisher, DDSSubscriber, and DDSTopic.
Prior to deleting each contained entity, this operation will recursively call the corresponding delete_contained_entities operation on each contained entity (if applicable). This pattern is applied recursively. In this manner the operation delete_contained_entities() on the DDSDomainParticipant will end up deleting all the entities recursively contained in the DDSDomainParticipant, that is also the DDSDataWriter, and DDSDataReader.
The operation will fail with DDS_RETCODE_PRECONDITION_NOT_MET if any of the contained entities is in a state where it cannot be deleted.
If delete_contained_entities() completes successfully, the application may delete the DDSDomainParticipant knowing that it has no contained entities.
|
pure virtual |
<<eXtension>> <<cert>> Allows an application to communicate to RTI Connext DDS Micro the existence of a data type.
The generated implementation of the operation embeds all the knowledge that has to be communicated to the middleware in order to make it able to manage the contents of data of that type. This includes in particular the key definition that will allow RTI Connext DDS Micro to distinguish different instances of the same type.
The same NDDS_Type_Plugin can be registered multiple times with a DDSDomainParticipant using the same or different values for the type_name
. If register_type
is called multiple times on the same NDDS_Type_Plugin with the same DDSDomainParticipant and type_name
, the second (and subsequent) registrations are ignored by the operation fails with DDS_RETCODE_OK.
type_name
to register two different NDDS_Type_Plugin with the same DDSDomainParticipant, or else the operation will fail and DDS_RETCODE_PRECONDITION_NOT_MET will be returned. type_name | <<in>> the type name under with the data type Foo is registered with the participant; this type name is used when creating a new DDSTopic. (See DDSDomainParticipant::create_topic.) The name may not be NULL or longer than 255 characters. |
plugin | <<in>> the Foo type plugin to register the data type with. Cannot be NULL. |
|
pure virtual |
Allows an application to unregister a data type from RTI Connext DDS Micro. After calling unregister_type, no further communication using that type is possible.
The generated implementation of the operation removes all the information about a type from RTI Connext DDS Micro. No further communication using that type is possible.
type_name
is registered with the participant and all DDSTopic objects referencing the type have been destroyed. If the type is not registered with the participant, or if any DDSTopic is associated with the type, the operation will fail with DDS_RETCODE_ERROR. type_name | <<in>> the type name under with the data type Foo is registered with the participant. The name should match a name that has been previously used to register a type with the participant. Cannot be NULL. |
|
pure virtual |
Sets the participant listener.
listener | <<in>> Listener to be installed on entity. |
mask | <<in>> Changes of communication status to be invoked on the listener. |
Care should therefore be taken not to delete any listener that has been set on an enabled participant unless some application-specific means are available of ensuring that the old listener cannot still be in use.
|
pure virtual |
Get the participant listener.
|
pure virtual |
<<cert>> Returns the current value of the time.
The current value of the time that RTI Connext DDS Micro uses to time-stamp DDSDataWriter and to set the reception-timestamp for the data updates that it receives.
current_time | <<inout>> Current time to be filled up. |
|
pure virtual |
<<eXtension>> <<cert>> Attempt to contact one or more additional peer participants.
Add the given peer description to the list of peers with which this DDSDomainParticipant will try to communicate.
This method may be called at any time after this DDSDomainParticipant has been created, before or after it has been enabled. If it is called after DDSEntity::enable, an attempt will be made to contact the new peer(s) immediately. If it is called before, the peer description will simply be added to the list that was populated by DDS_DiscoveryQosPolicy::initial_peers; the first attempted contact will take place after this DDSDomainParticipant is enabled.
Adding a peer description with this method does not guarantee that any peer(s) discovered as a result will exactly correspond to those described:
Adding a peer description with this method has no effect the DDS_DiscoveryQosPolicy::initial_peers.
peer | <<in>> New peer descriptor to be added. |