RTI Connext Modern C++ API Version 7.3.0
dds::topic Namespace Reference

Contains topic related classes and functions, the built-in topics and topic traits used by IDL-generated types. More...

Namespaces

namespace  qos
 Contains TopicQos.
 

Classes

class  AnyTopic
 <<reference-type>> This class provides an non-template holder for representing a Topic of any type More...
 
class  BuiltinTopicKey
 The key of the built-in topics. More...
 
class  ContentFilteredTopic
 <<reference-type>> Specialization of TopicDescription that allows for content-based subscriptions. More...
 
class  Filter
 Defines the filter to create a ContentFilteredTopic. More...
 
struct  is_topic_type
 Trait that indicates if a type is suitable to be the type of a dds::topic::Topic. More...
 
class  NoOpTopicListener
 A convenience implementation of TopicListener where all methods are overridden to do nothing. More...
 
class  ParticipantBuiltinTopicData
 Entry created when a dds::domain::DomainParticipant is discovered. More...
 
class  PublicationBuiltinTopicData
 Entry created when a dds::pub::DataWriter is discovered in association with its dds::pub::Publisher. More...
 
class  SubscriptionBuiltinTopicData
 Entry created when a dds::sub::DataReader is discovered in association with its dds::sub::Subscriber. More...
 
class  Topic
 <<reference-type>> Topic is the most basic description of the data to be published and subscribed. More...
 
struct  topic_type_name
 Provides the name of a topic-type. More...
 
struct  topic_type_support
 Provides convenience operations for a topic-type. More...
 
class  TopicBuiltinTopicData
 Entry created when a dds::topic::Topic object is discovered. More...
 
class  TopicDescription
 Abstract base class of Topic and ContentFilteredTopic. More...
 
class  TopicInstance
 Encapsulates a sample and its associated instance handle. More...
 
class  TopicListener
 The listener to notify status changes for a dds::topic::Topic. More...
 

Functions

template<typename T >
Topic< T > get (const AnyTopic &any_topic)
 Same as AnyTopic::get() More...
 
template<typename FwdIterator >
int32_t discover_any_topic (const dds::domain::DomainParticipant &participant, FwdIterator begin, int32_t max_size)
 Retrieves the topics discovered in a DomainParticipant. More...
 
template<typename BinIterator >
int32_t discover_any_topic (const dds::domain::DomainParticipant &participant, BinIterator begin)
 Retrieves the topics discovered in a DomainParticipant. More...
 
dds::topic::TopicBuiltinTopicData discover_topic_data (const dds::domain::DomainParticipant &participant, const dds::core::InstanceHandle &topic_handle)
 Gets the information about a discovered topic. More...
 
template<typename FwdIterator >
int32_t discover_topic_data (const dds::domain::DomainParticipant &participant, FwdIterator begin, const dds::core::InstanceHandleSeq &handles)
 Gets the information about several topics. More...
 
template<typename FwdIterator >
int32_t discover_topic_data (const dds::domain::DomainParticipant &participant, FwdIterator begin, int32_t max_size)
 Gets the information about all topics. More...
 
template<typename BinIterator >
int32_t discover_topic_data (const dds::domain::DomainParticipant &participant, BinIterator begin)
 Gets the information about all topics. More...
 
void ignore (dds::domain::DomainParticipant &participant, const dds::core::InstanceHandle &handle)
 Instructs a DomainParticipant to ignore a topic. More...
 
template<typename FwdIterator >
void ignore (dds::domain::DomainParticipant &participant, FwdIterator begin, FwdIterator end)
 Ignores a range of topics. More...
 
template<typename TOPIC >
TOPIC find (const dds::domain::DomainParticipant &participant, const std::string &topic_name)
 Looks up a Topic from a DomainParticipant. More...
 
std::string participant_topic_name ()
 Participant builtin topic name. More...
 
std::string topic_topic_name ()
 Topic topic name. More...
 
std::string publication_topic_name ()
 Publication topic name. More...
 
std::string subscription_topic_name ()
 Subscription topic name. More...
 

Detailed Description

Contains topic related classes and functions, the built-in topics and topic traits used by IDL-generated types.

Function Documentation

◆ get()

template<typename T >
Topic< T > get ( const AnyTopic any_topic)

Same as AnyTopic::get()

◆ discover_any_topic() [1/2]

template<typename FwdIterator >
int32_t discover_any_topic ( const dds::domain::DomainParticipant participant,
FwdIterator  begin,
int32_t  max_size 
)

Retrieves the topics discovered in a DomainParticipant.

Template Parameters
FwdIteratorA forward iterator whose value type is dds::core::InstanceHandle
Parameters
participantThe DomainParticipant where to look up the discovered topics
beginThe beginning of the range where to insert the InstanceHandles that correspond to the discovered topics
max_sizeThe maximum number of topics to insert or dds::core::LENGTH_UNLIMITED

Referenced by dds::topic::Topic< T >::discover_any_topic().

◆ discover_any_topic() [2/2]

template<typename BinIterator >
int32_t discover_any_topic ( const dds::domain::DomainParticipant participant,
BinIterator  begin 
)

Retrieves the topics discovered in a DomainParticipant.

This is equivalent to discover_any_topic(participant, begin, dds::core::LENGTH_UNLIMITED)

◆ discover_topic_data() [1/4]

dds::topic::TopicBuiltinTopicData dds::topic::discover_topic_data ( const dds::domain::DomainParticipant participant,
const dds::core::InstanceHandle topic_handle 
)

Gets the information about a discovered topic.

Returns dds::topic::TopicBuiltinTopicData for the specified dds::topic::Topic.

This operation retrieves information on a dds::topic::Topic that has been discovered by the local Participant and must not have been "ignored" by means of the dds::topic::ignore() operation.

The topic_handle must correspond to such a topic. Otherwise, the operation will fail with dds::core::PreconditionNotMetError.

This call is not supported for remote topics. If a remote topic_handle is used, the operation will fail with dds::core::UnsupportedError.

Use the operation dds::topic::discover_any_topic() to find the topics that are currently discovered.

Parameters
participantThe DomainParticipant where to look up the topic information
topic_handle<<in>> dds::core::InstanceHandle of dds::topic::Topic.
Exceptions
Oneof the Standard Exceptions, dds::core::PreconditionNotMetError or dds::core::NotEnabledError
See also
dds::topic::TopicBuiltinTopicData
dds::topic::discover_any_topic()

Referenced by dds::topic::Topic< T >::discover_topic_data().

◆ discover_topic_data() [2/4]

template<typename FwdIterator >
int32_t discover_topic_data ( const dds::domain::DomainParticipant participant,
FwdIterator  begin,
const dds::core::InstanceHandleSeq handles 
)

Gets the information about several topics.

◆ discover_topic_data() [3/4]

template<typename FwdIterator >
int32_t discover_topic_data ( const dds::domain::DomainParticipant participant,
FwdIterator  begin,
int32_t  max_size 
)

Gets the information about all topics.

Template Parameters
Aforward iterator whose value type is dds::topic::TopicBuiltinTopicData
Parameters
participantThe DomainParticipant where to look up all the topics
beginThe beginning of a range where to copy the topic data
max_sizeThe maximum number of items to copy or dds::core::LENGTH_UNLIMITED

◆ discover_topic_data() [4/4]

template<typename BinIterator >
int32_t discover_topic_data ( const dds::domain::DomainParticipant participant,
BinIterator  begin 
)

Gets the information about all topics.

◆ ignore() [1/2]

void ignore ( dds::domain::DomainParticipant participant,
const dds::core::InstanceHandle handle 
)

Instructs a DomainParticipant to ignore a topic.

Instructs RTI Connext to locally ignore a dds::topic::Topic.

This means it will locally ignore any publication, or subscription to the dds::topic::Topic.

There is no way to reverse this operation.

This operation can be used to save local resources when the application knows that it will never publish or subscribe to data under certain topics.

The dds::topic::Topic to ignore is identified by the handle argument. This is the handle of a dds::topic::Topic that appears in the dds::sub::SampleInfo retrieved when reading data samples from the built-in dds::sub::DataReader for the dds::topic::Topic.

Parameters
participantThe DomainParticipant where to ignore the topic
handle<<in>> Handle of the dds::topic::Topic to be ignored.
Exceptions
Oneof the Standard Exceptions, dds::core::OutOfResourcesError or dds::core::NotEnabledError
See also
dds::topic::TopicBuiltinTopicData
dds::topic::topic_topic_name()
dds::sub::builtin_subscriber

Referenced by dds::topic::Topic< T >::ignore().

◆ ignore() [2/2]

template<typename FwdIterator >
void ignore ( dds::domain::DomainParticipant participant,
FwdIterator  begin,
FwdIterator  end 
)

◆ find()

template<typename TOPIC >
TOPIC find ( const dds::domain::DomainParticipant participant,
const std::string &  topic_name 
)

Looks up a Topic from a DomainParticipant.

Template Parameters
TOPICThe topic to find; it can be one of the following:
Parameters
participantThe DomainParticipant that contains the Topic
topic_nameThe topic name
Returns
A reference to an existing Topic in this participant or an empty reference (i.e. equals to dds::core::null) if it doesn't exist.
Exceptions
dds::core::InvalidDowncastErrorIf the concrete type of the topic description identified by topic_name is not TOPIC. For example, if the topic_name identifies a topic of type Bar, but the template parameter was dds::topic::Topic<Foo>.

The participant doesn't need to be enabled. The returned topic may be enabled or disabled.