| Fast DDS Version 3.3.0 Fast DDS

Loading...
Searching...
No Matches
Topic.hpp
1// Copyright 2020 Proyectos y Sistemas de Mantenimiento SL (eProsima).
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
18
19#ifndef FASTDDS_DDS_TOPIC__TOPIC_HPP
20#define FASTDDS_DDS_TOPIC__TOPIC_HPP
21
22#include <fastdds/fastdds_dll.hpp>
23#include <fastdds/dds/core/Entity.hpp>
24#include <fastdds/dds/core/ReturnCode.hpp>
25#include <fastdds/dds/core/status/BaseStatus.hpp>
26#include <fastdds/dds/topic/TopicDescription.hpp>
27#include <fastdds/dds/topic/qos/TopicQos.hpp>
28
29 namespace dds {
30 namespace topic {
31
32 class Topic;
33
34} // namespace topic
35} // namespace dds
36
37 namespace eprosima {
38 namespace fastdds {
39 namespace dds {
40
41 class DomainParticipant;
42 class TopicListener;
43 class DomainParticipantImpl;
44 class TopicProxy;
45
52 class Topic : public DomainEntity, public TopicDescription
53{
54 friend class TopicProxy;
55 friend class DomainParticipantImpl;
56
61 Topic(
62 const std::string& topic_name,
63 const std::string& type_name,
64 TopicProxy* p,
65 const StatusMask& mask = StatusMask::all());
66
67 Topic(
68 DomainParticipant* dp,
69 const std::string& topic_name,
70 const std::string& type_name,
71 const TopicQos& qos = TOPIC_QOS_DEFAULT,
72 TopicListener* listener = nullptr,
73 const StatusMask& mask = StatusMask::all());
74
75 public:
76
77 virtual ~Topic();
78
84 virtual DomainParticipant* get_participant() const override;
85
93 FASTDDS_EXPORTED_API ReturnCode_t get_inconsistent_topic_status(
94 InconsistentTopicStatus& status);
95
101 FASTDDS_EXPORTED_API const TopicQos& get_qos() const;
102
109 FASTDDS_EXPORTED_API ReturnCode_t get_qos(
110 TopicQos& qos) const;
111
121 FASTDDS_EXPORTED_API ReturnCode_t set_qos(
122 const TopicQos& qos);
123
129 FASTDDS_EXPORTED_API const TopicListener* get_listener() const;
130
138 FASTDDS_EXPORTED_API ReturnCode_t set_listener(
139 TopicListener* listener,
140 const StatusMask& mask = StatusMask::all());
141
142 TopicDescriptionImpl* get_impl() const override;
143
144 protected:
145
146 TopicProxy* impl_;
147
148 friend class ::dds::topic::Topic;
149
150};
151
152} // namespace dds
153} // namespace fastdds
154} // namespace eprosima
155
156#endif // FASTDDS_DDS_TOPIC__TOPIC_HPP
eprosima::fastdds::dds::DomainEntity::DomainEntity
DomainEntity(const StatusMask &mask=StatusMask::all())
Constructor.
Definition Entity.hpp:184
eprosima::fastdds::dds::DomainParticipant
Class DomainParticipant used to group Publishers and Subscribers into a single working unit.
Definition DomainParticipant.hpp:86
eprosima::fastdds::dds::StatusMask
StatusMask is a bitmap or bitset field.
Definition StatusMask.hpp:48
eprosima::fastdds::dds::StatusMask::all
static StatusMask all()
Get all StatusMasks.
Definition StatusMask.hpp:104
eprosima::fastdds::dds::TopicDescription::TopicDescription
TopicDescription(const std::string &name, const std::string &type_name)
Definition TopicDescription.hpp:72
eprosima::fastdds::dds::Topic::~Topic
virtual ~Topic()
eprosima::fastdds::dds::Topic::get_qos
FASTDDS_EXPORTED_API const TopicQos & get_qos() const
Allows accessing the Topic Qos.
eprosima::fastdds::dds::Topic::TopicProxy
friend class TopicProxy
Definition Topic.hpp:54
eprosima::fastdds::dds::Topic::get_qos
FASTDDS_EXPORTED_API ReturnCode_t get_qos(TopicQos &qos) const
Retrieves the Topic Qos.
eprosima::fastdds::dds::Topic::get_inconsistent_topic_status
FASTDDS_EXPORTED_API ReturnCode_t get_inconsistent_topic_status(InconsistentTopicStatus &status)
Allows the application to retrieve the INCONSISTENT_TOPIC_STATUS status of a Topic.
eprosima::fastdds::dds::Topic::set_qos
FASTDDS_EXPORTED_API ReturnCode_t set_qos(const TopicQos &qos)
Allows modifying the Topic Qos.
eprosima::fastdds::dds::Topic::get_participant
virtual DomainParticipant * get_participant() const override
Getter for the DomainParticipant.
eprosima::fastdds::dds::Topic::set_listener
FASTDDS_EXPORTED_API ReturnCode_t set_listener(TopicListener *listener, const StatusMask &mask=StatusMask::all())
Modifies the TopicListener.
eprosima::fastdds::dds::Topic::get_listener
FASTDDS_EXPORTED_API const TopicListener * get_listener() const
Retrieves the attached TopicListener.
eprosima::fastdds::dds::Topic::impl_
TopicProxy * impl_
Definition Topic.hpp:146
eprosima::fastdds::dds::Topic::get_impl
TopicDescriptionImpl * get_impl() const override
eprosima::fastdds::dds::Topic::DomainParticipantImpl
friend class DomainParticipantImpl
Definition Topic.hpp:55
eprosima::fastdds::dds::Topic::Topic
friend class ::dds::topic::Topic
Definition Topic.hpp:148
eprosima::fastdds::dds::TopicListener
Class TopicListener, it should be used by the end user to implement specific callbacks to certain act...
Definition TopicListener.hpp:37
eprosima::fastdds::dds::TopicQos
Class TopicQos, containing all the possible Qos that can be set for a determined Topic.
Definition TopicQos.hpp:40
dds::topic
Definition Topic.hpp:30
dds
Definition DomainParticipant.hpp:46
eprosima::fastdds::dds::TOPIC_QOS_DEFAULT
FASTDDS_EXPORTED_API const TopicQos TOPIC_QOS_DEFAULT
eprosima::fastdds::dds::InconsistentTopicStatus
BaseStatus InconsistentTopicStatus
Alias of BaseStatus.
Definition BaseStatus.hpp:43
eprosima::fastdds::dds::ReturnCode_t
int32_t ReturnCode_t
Definition DDSReturnCode.hpp:59
eprosima
eProsima namespace.