CoreDX DDS Modern C++ API
Public Member Functions | List of all members
dds::topic::AnyTopic Class Reference

Typeless base class for the typed Topic. More...

Inheritance diagram for dds::topic::AnyTopic:
Inheritance graph
[legend]
Collaboration diagram for dds::topic::AnyTopic:
Collaboration graph
[legend]

Public Member Functions

dds::topic::qos::TopicQos qos () const
 Gets the TopicQos setting for this instance. More...
 
void qos (const dds::topic::qos::TopicQos &qos)
 This operation replaces the existing set of QosPolicy settings for a Topic. More...
 
AnyTopicoperator<< (const dds::topic::qos::TopicQos &qos)
 This operation replaces the existing set of QosPolicy settings for a Topic. More...
 
const AnyTopicoperator>> (dds::topic::qos::TopicQos &qos) const
 Populates the target qos with the qos policies in this instance. More...
 
dds::core::status::InconsistentTopicStatus inconsistent_topic_status () const
 This operation obtains the InconsistentTopicStatus object of the Topic. More...
 
- 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...
 
- Public Member Functions inherited from dds::topic::TopicDescription
const std::string & name () const
 This operation returns the name used to create the TopicDescription. More...
 
const std::string & type_name () const
 This operation returns the registered name of the data type associated with the TopicDescription. More...
 
const dds::domain::DomainParticipantdomain_participant () const
 This operation returns the DomainParticipant associated with the TopicDescription. More...
 
const dds::domain::DomainParticipantparticipant () const
 This operation returns the DomainParticipant associated with the TopicDescription. More...
 

Detailed Description

Typeless base class for the typed Topic.

Topics are created type specific (fi Topic<Foo::Bar> topic). However, there are a few places in the API (and possibly application) where the type can not be known while still some Topic has to be passed around, stored or even typeless functionality called.
The main examples in the API that needs typeless Topic is: DomainParticipantListener.

See also
dds::topic::Topic

Member Function Documentation

◆ inconsistent_topic_status()

dds::core::status::InconsistentTopicStatus dds::topic::AnyTopic::inconsistent_topic_status ( ) const

This operation obtains the InconsistentTopicStatus object of the Topic.

The InconsistentTopicStatus can also be monitored using a TopicListener or by using the associated StatusCondition.

Returns
the SampleRejectedStatus
Exceptions
dds::core::ErrorAn internal error has occurred.
dds::core::NullReferenceErrorThe entity was not properly created and references to dds::core::null.
dds::core::AlreadyClosedErrorThe entity has already been closed.
dds::core::OutOfResourcesErrorThe Data Distribution Service ran out of resources to complete this operation.

◆ operator<<()

AnyTopic& dds::topic::AnyTopic::operator<< ( const dds::topic::qos::TopicQos qos)

This operation replaces the existing set of QosPolicy settings for a Topic.

The parameter qos contains the object with the QosPolicy settings which is checked for self-consistency and mutability.

When the application tries to change a QosPolicy setting for an enabled Topic, which can only be set before the Topic is enabled, the operation will fail and a ImmutablePolicyError is thrown. In other words, the application must provide the presently set QosPolicy settings in case of the immutable QosPolicy settings. Only the mutable QosPolicy settings can be changed.

When the qos contains conflicting QosPolicy settings (not self-consistent), the operation will fail and an InconsistentPolicyError is thrown.

Parameters
qosthe qos
Exceptions
dds::core::ErrorAn internal error has occurred.
dds::core::NullReferenceErrorThe entity was not properly created and references to dds::core::null.
dds::core::AlreadyClosedErrorThe entity has already been closed.
dds::core::OutOfResourcesErrorThe Data Distribution Service ran out of resources to complete this operation.
dds::core::ImmutablePolicyErrorThe parameter qos contains an immutable QosPolicy setting with a different value than set during enabling of the DataReader.
dds::core::InconsistentPolicyErrorThe parameter qos contains conflicting QosPolicy settings,

◆ operator>>()

const AnyTopic& dds::topic::AnyTopic::operator>> ( dds::topic::qos::TopicQos qos) const

Populates the target qos with the qos policies in this instance.

Returns
the unmodified Topic
Exceptions
dds::core::ErrorAn internal error has occurred.
dds::core::NullReferenceErrorThe entity was not properly created and references to dds::core::null.
dds::core::AlreadyClosedErrorThe entity has already been closed.
dds::core::OutOfResourcesErrorThe Data Distribution Service ran out of resources to complete this operation.

◆ qos() [1/2]

dds::topic::qos::TopicQos dds::topic::AnyTopic::qos ( ) const

Gets the TopicQos setting for this instance.

Returns
the qos
Exceptions
dds::core::ErrorAn internal error has occurred.
dds::core::NullReferenceErrorThe entity was not properly created and references to dds::core::null.
dds::core::AlreadyClosedErrorThe entity has already been closed.
dds::core::OutOfResourcesErrorThe Data Distribution Service ran out of resources to complete this operation.

◆ qos() [2/2]

void dds::topic::AnyTopic::qos ( const dds::topic::qos::TopicQos qos)

This operation replaces the existing set of QosPolicy settings for a Topic.

The parameter qos contains the object with the QosPolicy settings which is checked for self-consistency and mutability.

When the application tries to change a QosPolicy setting for an enabled Topic, which can only be set before the Topic is enabled, the operation will fail and a ImmutablePolicyError is thrown. In other words, the application must provide the presently set QosPolicy settings in case of the immutable QosPolicy settings. Only the mutable QosPolicy settings can be changed.

When the qos contains conflicting QosPolicy settings (not self-consistent), the operation will fail and an InconsistentPolicyError is thrown.

Parameters
qosthe qos
Exceptions
dds::core::ErrorAn internal error has occurred.
dds::core::NullReferenceErrorThe entity was not properly created and references to dds::core::null.
dds::core::AlreadyClosedErrorThe entity has already been closed.
dds::core::OutOfResourcesErrorThe Data Distribution Service ran out of resources to complete this operation.
dds::core::ImmutablePolicyErrorThe parameter qos contains an immutable QosPolicy setting with a different value than set during enabling of the DataReader.
dds::core::InconsistentPolicyErrorThe parameter qos contains conflicting QosPolicy settings,

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