/src/Fast-DDS/src/cpp/fastdds/topic/Topic.cpp
Line | Count | Source |
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 | | |
15 | | /** |
16 | | * @file Topic.cpp |
17 | | * |
18 | | */ |
19 | | |
20 | | #include <fastdds/dds/topic/Topic.hpp> |
21 | | #include <fastdds/dds/domain/DomainParticipant.hpp> |
22 | | #include <fastdds/topic/TopicProxy.hpp> |
23 | | |
24 | | #include <fastdds/dds/log/Log.hpp> |
25 | | |
26 | | namespace eprosima { |
27 | | namespace fastdds { |
28 | | namespace dds { |
29 | | |
30 | | Topic::Topic( |
31 | | const std::string& topic_name, |
32 | | const std::string& type_name, |
33 | | TopicProxy* p, |
34 | | const StatusMask& mask) |
35 | 0 | : DomainEntity(mask) |
36 | 0 | , TopicDescription(topic_name, type_name) |
37 | 0 | , impl_(p) |
38 | 0 | { |
39 | 0 | } |
40 | | |
41 | | Topic::Topic( |
42 | | DomainParticipant* dp, |
43 | | const std::string& topic_name, |
44 | | const std::string& type_name, |
45 | | const TopicQos& qos, |
46 | | TopicListener* listener, |
47 | | const StatusMask& mask) |
48 | 0 | : DomainEntity(mask) |
49 | 0 | , TopicDescription(topic_name, type_name) |
50 | 0 | , impl_(dp->create_topic(topic_name, type_name, qos, listener, mask)->impl_) |
51 | 0 | { |
52 | 0 | } |
53 | | |
54 | | Topic::~Topic() |
55 | 0 | { |
56 | 0 | } |
57 | | |
58 | | const TopicQos& Topic::get_qos() const |
59 | 0 | { |
60 | 0 | return impl_->get_qos(); |
61 | 0 | } |
62 | | |
63 | | ReturnCode_t Topic::get_qos( |
64 | | TopicQos& qos) const |
65 | 0 | { |
66 | 0 | qos = impl_->get_qos(); |
67 | 0 | return RETCODE_OK; |
68 | 0 | } |
69 | | |
70 | | ReturnCode_t Topic::set_qos( |
71 | | const TopicQos& qos) |
72 | 0 | { |
73 | 0 | return impl_->set_qos(qos); |
74 | 0 | } |
75 | | |
76 | | const TopicListener* Topic::get_listener() const |
77 | 0 | { |
78 | 0 | return impl_->get_listener(); |
79 | 0 | } |
80 | | |
81 | | ReturnCode_t Topic::set_listener( |
82 | | TopicListener* listener, |
83 | | const StatusMask& mask) |
84 | 0 | { |
85 | 0 | impl_->set_listener(listener, mask); |
86 | 0 | return RETCODE_OK; |
87 | 0 | } |
88 | | |
89 | | DomainParticipant* Topic::get_participant() const |
90 | 0 | { |
91 | 0 | return impl_->get_participant(); |
92 | 0 | } |
93 | | |
94 | | ReturnCode_t Topic::get_inconsistent_topic_status( |
95 | | InconsistentTopicStatus& status) |
96 | 0 | { |
97 | | // TODO: return impl_->get_inconsistent_topic_status(status); |
98 | 0 | (void)status; |
99 | 0 | return RETCODE_UNSUPPORTED; |
100 | 0 | } |
101 | | |
102 | | TopicDescriptionImpl* Topic::get_impl() const |
103 | 0 | { |
104 | 0 | return impl_; |
105 | 0 | } |
106 | | |
107 | | } /* namespace dds */ |
108 | | } /* namespace fastdds */ |
109 | | } /* namespace eprosima */ |
110 | | |