CoreDX DDS Modern C++ API
Public Member Functions | Static Public Member Functions | List of all members
dds::domain::DomainParticipant Class Reference

The DomainParticipant is used to configure, create and destroy Publisher, Subscriber and Topic objects. More...

Inheritance diagram for dds::domain::DomainParticipant:
Inheritance graph
[legend]
Collaboration diagram for dds::domain::DomainParticipant:
Collaboration graph
[legend]

Public Member Functions

 DomainParticipant (uint32_t did)
 Create a new DomainParticipant object. More...
 
 DomainParticipant (uint32_t id, const dds::domain::qos::DomainParticipantQos &qos, dds::domain::DomainParticipantListener *listener=NULL, const dds::core::status::StatusMask &mask=dds::core::status::StatusMask::none())
 Create a new DomainParticipant object. More...
 
void listener (Listener *the_listener, const dds::core::status::StatusMask &event_mask)
 Register a listener with the DomainParticipant. More...
 
Listenerlistener () const
 Get the listener of this DomainParticipant.
 
const dds::domain::qos::DomainParticipantQosqos () const
 Return the DomainParticipantQos setting for this instance. More...
 
uint32_t domain_id () const
 This operation retrieves the domain_id used to create the DomainParticipant. More...
 
void assert_liveliness ()
 This operation manually asserts the liveliness of the DataWriter. More...
 
bool contains_entity (const dds::core::InstanceHandle &handle)
 This operation checks whether or not the given a_handle represents an Entity that was created from the DomainParticipant. More...
 
dds::core::Time current_time () const
 This operation returns the current value of the time that the service uses to time-stamp data writes and to set the reception timestamp for the data updates it receives.
 
- Public Member Functions inherited from dds::core::Entity
void enable ()
 This operation enables the Entity. More...
 
const dds::core::status::StatusMask status_changes ()
 This operation retrieves the list of communication statuses in the Entity that are triggered.That is, the list of statuses whose value has changed since the last time the application read the status. More...
 
const dds::core::InstanceHandle instance_handle () const
 This operation returns the InstanceHandle_t that represents the Entity.
 
void close ()
 This method closes the entity and releases all resources associated with DDS, such as threads, sockets, buffers, etc. More...
 
void retain ()
 Indicates that references to this object may go out of scope but that the application expects to look it up again later. More...
 
- Public Member Functions inherited from dds::core::Reference< DELEGATE >
 Reference (dds::core::null_type &)
 Creates a "null" reference.
 
 Reference (const Reference &ref)
 Creates a reference from another. More...
 
template<typename D >
 Reference (const Reference< D > &ref)
 Enables safe assignment from other reference types. More...
 
 Reference (DELEGATE_T *p)
 The following two constructors create a dds Reference from a vendor specific delegate. More...
 
 ~Reference ()
 Destroys a reference.
 
template<typename R >
bool operator== (const R &ref) const
 Compares two reference objects and returns true if they are equal. More...
 
template<typename R >
bool operator!= (const R &ref) const
 Compares two reference objects and returns true if they are not-equal. More...
 
Referenceoperator= (const null_type)
 Special assignment operators that takes care of assigning null to this reference. More...
 
bool is_nil () const
 Returns true if this reference object is nil, meaning pointing to null.
 
bool operator== (const null_type) const
 Special operator== used to check if this reference object equals the null reference. More...
 
bool operator!= (const null_type nil) const
 Special operator!= used to check if this reference object does not equals the null reference. More...
 
const DELEGATE_REF_T & delegate () const
 Returns a reference to the underlying delegate. More...
 
DELEGATE_REF_T & delegate ()
 Returns a reference to the underlying delegate. More...
 
DELEGATE * operator-> ()
 The operator->() is provided to be able to directly invoke methods on the delegate. More...
 
const DELEGATE * operator-> () const
 The operator->() is provided to be able to directly invoke methods on the delegate. More...
 

Static Public Member Functions

static const dds::domain::qos::DomainParticipantFactoryQosparticipant_factory_qos ()
 
static void participant_factory_qos (const dds::domain::qos::DomainParticipantFactoryQos &the_qos)
 

Detailed Description

The DomainParticipant is used to configure, create and destroy Publisher, Subscriber and Topic objects.

The DomainParticipant is a container for the objects that it creates. The objects operate within the domain identified by the domain_id provided when the DomainParticipant was created. Objects within different domains do not communicate or interfere with each other.

Constructor & Destructor Documentation

◆ DomainParticipant() [1/2]

dds::domain::DomainParticipant::DomainParticipant ( uint32_t  did)

Create a new DomainParticipant object.

The DomainParticipant signifies that the calling application intends to join the Domain identified by the domain_id argument. The DomainParticipant will be created with DomainParticipantQos passed as argument.

Parameters
didthe id of the domain joined by the new DomainParticipant.

◆ DomainParticipant() [2/2]

dds::domain::DomainParticipant::DomainParticipant ( uint32_t  id,
const dds::domain::qos::DomainParticipantQos qos,
dds::domain::DomainParticipantListener listener = NULL,
const dds::core::status::StatusMask mask = dds::core::status::StatusMask::none() 
)

Create a new DomainParticipant object.

The DomainParticipant signifies that the calling application intends to join the Domain identified by the domain_id argument. The DomainParticipant will be created with DomainParticipantQos passed as argument.

Parameters
idthe id of the domain joined by this DomainParticipant.
qosthe QoS settings for this DomainParticipant
listenera listener to install (optional)
maskthe StatusMask indicating which status events should trigger a listener callback

Member Function Documentation

◆ assert_liveliness()

void dds::domain::DomainParticipant::assert_liveliness ( )

This operation manually asserts the liveliness of the DataWriter.

This is used in combination with the LIVELINESS QoS policy (see Section 7.1.3, Supported QoS, on page 96) to indicate to the Service that the entity remains active. This operation need only be used if the LIVELINESS setting is either MANUAL_BY_PARTICIPANT or MANUAL_BY_TOPIC. Otherwise, it has no effect.

Note Writing data via the write operation on a DataWriter asserts liveliness on the DataWriter itself and its DomainParticipant. Consequently the use of assert_liveliness is only needed if the application is not writing data regularly.

◆ contains_entity()

bool dds::domain::DomainParticipant::contains_entity ( const dds::core::InstanceHandle handle)

This operation checks whether or not the given a_handle represents an Entity that was created from the DomainParticipant.

The containment applies recursively. That is, it applies both to entities (TopicDescription, Publisher, or Subscriber) created directly using the DomainParticipant as well as entities created using a contained Publisher, or Subscriber as the factory, and so forth.

Parameters
handlethe instance handle for which the containement relationship has to be checked.
Returns
true if the handle belongs to an Entity belonging to this DomainParticipant

◆ domain_id()

uint32_t dds::domain::DomainParticipant::domain_id ( ) const

This operation retrieves the domain_id used to create the DomainParticipant.

The domain_id identifies the DDS domain to which the DomainParticipant belongs. As described in the introduction to Section 7.1.2.2.1, DomainParticipant Class, on page 22 each DDS domain represents a separate data communication plane isolated from other domains.

Returns
the domain id

◆ listener()

void dds::domain::DomainParticipant::listener ( Listener the_listener,
const dds::core::status::StatusMask event_mask 
)

Register a listener with the DomainParticipant.

The notifications received by the listener depend on the status mask with which it was registered.

Parameters
the_listenerthe listener
event_maskthe mask defining which events should trigger a listener callback

◆ qos()

const dds::domain::qos::DomainParticipantQos& dds::domain::DomainParticipant::qos ( ) const

Return the DomainParticipantQos setting for this instance.

Returns
the qos setting.

© 2009-2020 Twin Oaks Computing, Inc
Castle Rock, CO 80104
All rights reserved.