RTI Connext Modern C++ API
Version 7.0.0
|
<<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. More... | |
Topic (const dds::domain::DomainParticipant &dp, const std::string &topic_name, const std::string &the_type_name) | |
Creates a new topic. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
Topic (const dds::domain::DomainParticipant &dp, const std::string &topic_name, const dds::topic::qos::TopicQos &the_qos, std::shared_ptr< Listener > the_listener, const dds::core::status::StatusMask &mask=dds::core::status::StatusMask::all()) | |
Creates a new Topic. More... | |
Topic (const dds::domain::DomainParticipant &participant, const std::string &topic_name, const std::string &type_name, const dds::topic::qos::TopicQos &the_qos, std::shared_ptr< Listener > the_listener, const dds::core::status::StatusMask &mask=dds::core::status::StatusMask::all()) | |
Create a new topic. More... | |
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, std::shared_ptr< Listener > the_listener, const dds::core::status::StatusMask &mask=dds::core::status::StatusMask::all()) | |
Create a new topic with a dynamic type description. More... | |
void | listener (Listener *the_listener, const ::dds::core::status::StatusMask &event_mask) |
Sets the listener. More... | |
Listener * | listener () const |
Gets the listener. More... | |
void | set_listener (std::shared_ptr< Listener > the_listener, const dds::core::status::StatusMask &event_mask) |
Sets the listener associated with this topic. More... | |
void | set_listener (std::shared_ptr< Listener > the_listener) |
Sets the listener associated with this topic. More... | |
std::shared_ptr< Listener > | get_listener () const |
Returns the listener currently associated with this topic. More... | |
const dds::topic::qos::TopicQos | qos () const |
Gets the current TopicQos for this Topic. More... | |
void | qos (const dds::topic::qos::TopicQos &the_qos) |
Sets the TopicQos setting for this Topic. More... | |
dds::core::status::InconsistentTopicStatus | inconsistent_topic_status () const |
Retrieve the current InconsistentTopicStatus of this Topic. More... | |
Public Member Functions inherited from dds::topic::TopicDescription< T > | |
const std::string & | name () const |
Gets the topic name. More... | |
const std::string & | type_name () const |
Gets the type name. More... | |
const dds::domain::DomainParticipant & | participant () const |
Gets the related dds::domain::DomainParticipant. More... | |
Public Member Functions inherited from dds::core::Entity | |
void | enable () |
Enables this entity (if it was created disabled) More... | |
const dds::core::status::StatusMask | status_changes () |
Retrieves the list of communication statuses that are triggered. More... | |
const dds::core::InstanceHandle | instance_handle () const |
Get the instance handle that represents this entity. More... | |
void | close () |
Forces the destruction of this entity. More... | |
void | retain () |
Disables the automatic destruction of this entity. More... | |
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. 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... | |
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 More... | |
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 More... | |
Related Functions inherited from dds::core::Entity | |
template<typename TO , typename FROM > | |
TO | polymorphic_cast (const FROM &from) |
Downcasts an Entity to a subclass. More... | |
<<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 automatically deduces the type name, 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 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 |
|
inline |
Create a new topic.
[DEPRECATED] When using a listener, prefer the constructor that receives a shared_ptr<Listener>
instead of a regular Listener*
pointer.
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 | the event mask associated to the DataReader listener. |
|
inline |
Create a new topic with a dynamic type description.
This constructor uses a dynamic type description, the default TopicQos and doesn't set a listener.
|
inline |
Create a new topic with a dynamic type description.
[DEPRECATED] When using a listener, prefer the constructor that receives a shared_ptr<Listener>
instead of a regular Listener*
pointer.
Notice that in this case the data type T
has to be DynamicData. Thus the Topic type will be Topic<DynamicData>
.
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 | the event mask associated to the DataReader listener. |
|
inline |
Creates a new Topic.
This constructor deduces the type name automatically.
|
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 | A shared_ptr to the listener. See set_listener() for more information. |
mask | Indicates which status updates the listener will receive |
|
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_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 | A shared_ptr to the listener. See set_listener() for more information. |
mask | Indicates which status updates the listener will receive |
|
inline |
Sets the listener.
[DEPRECATED] The use of set_listener()
is recommended. Unlike this function, set_listener
receives a shared_ptr
which simplifies the management of listener's lifecycle.
the_listener | the topic listener |
event_mask | Changes of communication status to be invoked on the listener |
|
inline |
Gets the listener.
[DEPRECATED] Prefer get_listener()
instead of this function.
Returns the listener or NULL if there's no listener attached.
|
inline |
Sets the listener associated with this topic.
The topic will hold a shared_ptr
to the listener argument, ensuring that it is not deleted at least until this topic is deleted or the listener is reset with set_listener(nullptr)
.
the_listener | A shared pointer to the listener to receive status updates or nullptr to reset the current listener and stop receiving status updates. |
event_mask | A mask that indicates which status updates will be notified to the listener |
|
inline |
Sets the listener associated with this topic.
If the_listener
is not nullptr
, this overload is equivalent to:
If the_listener
is nullptr
, it is equivalent to:
the_listener | A shared pointer to the listener to receive status updates or nullptr to reset the current listener and stop receiving status updates. |
|
inline |
Returns the listener currently associated with this topic.
nullptr
if there is currently no listener associated to this entity.
|
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 to find; it can be one of the following:
|
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 . 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.
|
related |
<<extension>> Retrieve all the dds::topic::Topic created from this dds::domain::DomainParticipant
#include
<dds/topic/find.hpp>
AnyTopicBackInsertIterator | Type of the back-inserting iterator, whose value_type is dds::topic::AnyTopic. |
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
#include
<dds/topic/find.hpp>
AnyTopicBackInsertIterator | Type of the back-inserting iterator, whose value_type is dds::topic::AnyTopic. |
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 |