RTI Connext Modern C++ API
Version 5.3.1
|
<<reference-type>> Topic is the most basic description of the data to be published and subscribed. More...
#include <dds/topic/Topic.hpp>
Public Member Functions | |
Topic (const dds::domain::DomainParticipant &the_participant, const std::string &topic_name) | |
Creates a new topic. | |
Topic (const dds::domain::DomainParticipant &dp, const std::string &topic_name, const std::string &the_type_name) | |
Creates a new topic. | |
Topic (const dds::domain::DomainParticipant &dp, const std::string &topic_name, const dds::topic::qos::TopicQos &the_qos, dds::topic::TopicListener< T > *the_listener=NULL, const dds::core::status::StatusMask &mask=dds::core::status::StatusMask::all()) | |
Creates a new Topic. | |
Topic (const dds::domain::DomainParticipant &participant, const std::string &topic_name, const std::string &type_name, const dds::topic::qos::TopicQos &the_qos, dds::topic::TopicListener< T > *the_listener=NULL, const dds::core::status::StatusMask &mask=dds::core::status::StatusMask::all()) | |
Create a new topic. | |
Topic (const dds::domain::DomainParticipant &the_participant, const std::string &topic_name, const dds::core::xtypes::DynamicType &type) | |
Create a new topic with a dynamic type description. | |
Topic (const dds::domain::DomainParticipant &the_participant, const std::string &topic_name, const dds::core::xtypes::DynamicType &type, const dds::topic::qos::TopicQos &the_qos, dds::topic::TopicListener< T > *the_listener=NULL, const dds::core::status::StatusMask &mask=dds::core::status::StatusMask::all()) | |
Create a new topic with a dynamic type description. | |
void | listener (Listener *the_listener, const ::dds::core::status::StatusMask &event_mask) |
Sets the listener. | |
Listener * | listener () const |
Gets the listener. | |
dds::topic::qos::TopicQos | qos () const |
Gets the current TopicQos for this Topic. | |
void | qos (const dds::topic::qos::TopicQos &the_qos) |
Sets the TopicQos setting for this Topic. | |
dds::core::status::InconsistentTopicStatus | inconsistent_topic_status () const |
Retrieve the current InconsistentTopicStatus of this Topic. | |
Public Member Functions inherited from dds::topic::TopicDescription< T > | |
const std::string & | name () const |
Gets the topic name. | |
const std::string & | type_name () const |
Gets the type name. | |
const dds::domain::DomainParticipant & | participant () const |
Gets the related dds::domain::DomainParticipant. | |
Public Member Functions inherited from dds::core::Entity | |
void | enable () |
Enables this entity (if it was created disabled) | |
const dds::core::status::StatusMask | status_changes () |
Retrieves the list of communication statuses that are triggered. | |
const dds::core::InstanceHandle | instance_handle () const |
Get the instance handle that represents this entity. | |
void | close () |
Forces the destruction of this entity. | |
void | retain () |
Disables the automatic destruction of this entity. | |
Related Functions | |
(Note that these are not member functions.) | |
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<typename BinIterator > | |
int32_t | discover_any_topic (const dds::domain::DomainParticipant &participant, BinIterator begin) |
Retrieves the topics discovered in a DomainParticipant. | |
dds::topic::TopicBuiltinTopicData | discover_topic_data (const dds::domain::DomainParticipant &participant, const dds::core::InstanceHandle &topic_handle) |
Gets the information about a discovered topic. | |
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. | |
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<typename BinIterator > | |
int32_t | discover_topic_data (const dds::domain::DomainParticipant &participant, BinIterator begin) |
Gets the information about all topics. | |
void | ignore (dds::domain::DomainParticipant &participant, const dds::core::InstanceHandle &handle) |
Instructs a DomainParticipant to ignore a topic. | |
template<typename FwdIterator > | |
void | ignore (dds::domain::DomainParticipant &participant, FwdIterator begin, FwdIterator end) |
Ignores a range of topics. | |
template<typename TOPIC > | |
TOPIC | find (const dds::domain::DomainParticipant &participant, const std::string &topic_name) |
Looks up a Topic from a DomainParticipant. | |
template<typename AnyTopicBackInsertIterator > | |
uint32_t | find_topics (dds::domain::DomainParticipant participant, AnyTopicBackInsertIterator begin) |
<<extension>> Retrieve all the dds::topic::Topic created from this dds::domain::DomainParticipant | |
template<typename AnyTopicForwardIterator > | |
uint32_t | find_topics (dds::domain::DomainParticipant participant, AnyTopicForwardIterator begin, uint32_t max_size) |
<<extension>> Retrieve all the dds::topic::Topic created from this dds::domain::DomainParticipant | |
<<reference-type>> Topic is the most basic description of the data to be published and subscribed.
T | The type associated to this topic. It must be a type such that dds::topic::is_topic_type<T>::value is true (see dds::topic::is_topic_type). Valid types are IDL-generated types, the built-in types and dds::core::xtypes::DynamicData. |
A dds::topic::Topic is identified by its name, which must be unique in the whole domain. In addition (by virtue of extending TopicDescription) it fully specifies the type of the data that can be communicated when publishing or subscribing to the dds::topic::Topic.
dds::topic::Topic is the only TopicDescription that can be used for publications and therefore associated with a dds::pub::DataWriter.
The following operations may be called even if the dds::topic::Topic is not enabled. Other operations will fail with the value dds::core::NotEnabledError if called on a disabled dds::topic::Topic:
|
inline |
Creates a new topic.
This constructor behaves as the most general one where the type name is automatically deduced from dds::core::topic_type_name, it uses the default TopicQos and doesn't set a listener.
the_participant | The domain participant on which the topic will be defined. |
topic_name | The topic name. |
|
inline |
Creates a new topic.
This constructor behaves as the most general one except that it uses the default TopicQos and doesn't set a listener.
dp | The domain participant on which the topic will be defined. |
topic_name | The topic name. |
the_type_name | The name to register the type with |
|
inline |
Creates a new Topic.
This constructor behaves as the most general one except that the type name is automatically deduced from dds::core::topic_type_name
|
inline |
Create a new topic.
participant | The domain participant on which the topic will be defined. |
topic_name | The Topic name. Must not exceed 255 characters. |
type_name | The name given to the type T |
the_qos | The Qos settings for this Topic |
the_listener | the topic listener (default: NULL) |
mask | Changes of communication status to be invoked on the listener (default: all) |
|
inline |
Create a new topic with a dynamic type description.
|
inline |
Create a new topic with a dynamic type description.
Notice that in this case the data type T
has to be DynamicData. Thus the Topic type will be Topic<DynamicData>
.
The QoS will be set to dp.default_topic_qos().
the_participant | the domain participant on which the topic will be defined. |
topic_name | the topic's name. |
type | The DynamicType that describes the type for the DynamicData samples of this topic. |
the_qos | The Qos settings for this Topic |
the_listener | the topic listener (default: NULL) |
mask | Changes of communication status to be invoked on the listener (default: all) |
|
inline |
Sets the listener.
the_listener | the topic listener |
event_mask | Changes of communication status to be invoked on the listener |
|
inline |
Gets the listener.
Returns the listener or NULL if there's no listener attached.
|
inline |
Gets the current TopicQos for this Topic.
|
inline |
Sets the TopicQos setting for this Topic.
the_qos | Set of policies to be applied to the Topic. Immutable policies cannot be changed after this entity has been enabled. |
dds::core::ImmutablePolicyError | if the_qos contains a different value for an immutable policy. |
dds::core::InconsistentPolicyError | if some policies are inconsistent. |
|
inline |
Retrieve the current InconsistentTopicStatus of this Topic.
|
related |
Retrieves the topics discovered in a DomainParticipant.
FwdIterator | A forward iterator whose value type is dds::core::InstanceHandle |
participant | The DomainParticipant where to look up the discovered topics |
begin | The beginning of the range where to insert the InstanceHandles that correspond to the discovered topics |
max_size | The maximum number of topics to insert or dds::core::LENGTH_UNLIMITED |
|
related |
Retrieves the topics discovered in a DomainParticipant.
This is equivalent to discover_any_topic(participant, begin, dds::core::LENGTH_UNLIMITED)
|
related |
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.
participant | The DomainParticipant where to look up the topic information |
topic_handle | <<in>> dds::core::InstanceHandle of dds::topic::Topic. |
One | of the Standard Exceptions, dds::core::PreconditionNotMetError or dds::core::NotEnabledError |
|
related |
Gets the information about several topics.
|
related |
Gets the information about all topics.
A | forward iterator whose value type is dds::topic::TopicBuiltinTopicData |
participant | The DomainParticipant where to look up all the topics |
begin | The beginning of a range where to copy the topic data |
max_size | The maximum number of items to copy or dds::core::LENGTH_UNLIMITED |
|
related |
Gets the information about all topics.
|
related |
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.
participant | The DomainParticipant where to ignore the topic |
handle | <<in>> Handle of the dds::topic::Topic to be ignored. |
One | of the Standard Exceptions, dds::core::OutOfResourcesError or dds::core::NotEnabledError |
|
related |
Ignores a range of topics.
|
related |
Looks up a Topic from a DomainParticipant.
TOPIC | The topic, for example dds::topic::Topic<Foo> . |
participant | The DomainParticipant that contains the Topic |
topic_name | The topic name |
dds::core::InvalidDowncastError | If the concrete type of the topic description identified by topic_name is not TOPIC . |
The participant doesn't need to be enabled. The returned topic may be enabled or disabled.
|
related |
<<extension>> Retrieve all the dds::topic::Topic created from this dds::domain::DomainParticipant
AnyTopicBackInsertIterator | Type of the back-inserting iterator passed into this function |
participant | The dds::domain::DomainParticipant the Topics belong to |
begin | A back-inserting iterator to the position in the destination container to insert the found Topics into |
|
related |
<<extension>> Retrieve all the dds::topic::Topic created from this dds::domain::DomainParticipant
AnyTopicForwardIterator | Type of the forward iterator passed into this function |
participant | The dds::domain::DomainParticipant the Topics belong to |
begin | A forward iterator to the position in the destination container to insert the found Topics in |
max_size | The maximum number of Topics to return |