/src/Fast-DDS/include/fastdds/dds/publisher/qos/PublisherQos.hpp
Line | Count | Source (jump to first uncovered line) |
1 | | // Copyright 2019 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 PublisherQos.hpp |
17 | | */ |
18 | | |
19 | | |
20 | | #ifndef FASTDDS_DDS_PUBLISHER_QOS__PUBLISHERQOS_HPP |
21 | | #define FASTDDS_DDS_PUBLISHER_QOS__PUBLISHERQOS_HPP |
22 | | |
23 | | #include <fastdds/dds/core/policy/QosPolicies.hpp> |
24 | | |
25 | | namespace eprosima { |
26 | | namespace fastdds { |
27 | | namespace dds { |
28 | | |
29 | | /** |
30 | | * Class PublisherQos, containing all the possible Qos that can be set for a determined Publisher. |
31 | | * Although these values can be set and are transmitted |
32 | | * during the Endpoint Discovery Protocol, not all of the behaviour associated with them has been |
33 | | * implemented in the library. |
34 | | * Please consult each of them to check for implementation details and default values. |
35 | | * |
36 | | * @ingroup FASTDDS_QOS_MODULE |
37 | | */ |
38 | | class PublisherQos |
39 | | { |
40 | | public: |
41 | | |
42 | | /** |
43 | | * @brief Constructor |
44 | | */ |
45 | | FASTDDS_EXPORTED_API PublisherQos() |
46 | 4 | { |
47 | 4 | } |
48 | | |
49 | | /** |
50 | | * @brief Destructor |
51 | | */ |
52 | 0 | FASTDDS_EXPORTED_API virtual ~PublisherQos() = default; |
53 | | |
54 | | bool operator ==( |
55 | | const PublisherQos& b) const |
56 | 0 | { |
57 | 0 | return (this->presentation_ == b.presentation()) && |
58 | 0 | (this->partition_ == b.partition()) && |
59 | 0 | (this->group_data_ == b.group_data()) && |
60 | 0 | (this->entity_factory_ == b.entity_factory()); |
61 | 0 | } |
62 | | |
63 | | /** |
64 | | * Getter for PresentationQosPolicy |
65 | | * |
66 | | * @return PresentationQosPolicy reference |
67 | | */ |
68 | | const PresentationQosPolicy& presentation() const |
69 | 0 | { |
70 | 0 | return presentation_; |
71 | 0 | } |
72 | | |
73 | | /** |
74 | | * Getter for PresentationQosPolicy |
75 | | * |
76 | | * @return PresentationQosPolicy reference |
77 | | */ |
78 | | PresentationQosPolicy& presentation() |
79 | 0 | { |
80 | 0 | return presentation_; |
81 | 0 | } |
82 | | |
83 | | /** |
84 | | * Setter for PresentationQosPolicy |
85 | | * |
86 | | * @param presentation PresentationQosPolicy |
87 | | */ |
88 | | void presentation( |
89 | | const PresentationQosPolicy& presentation) |
90 | 0 | { |
91 | 0 | presentation_ = presentation; |
92 | 0 | } |
93 | | |
94 | | /** |
95 | | * Getter for PartitionQosPolicy |
96 | | * |
97 | | * @return PartitionQosPolicy reference |
98 | | */ |
99 | | const PartitionQosPolicy& partition() const |
100 | 0 | { |
101 | 0 | return partition_; |
102 | 0 | } |
103 | | |
104 | | /** |
105 | | * Getter for PartitionQosPolicy |
106 | | * |
107 | | * @return PartitionQosPolicy reference |
108 | | */ |
109 | | PartitionQosPolicy& partition() |
110 | 0 | { |
111 | 0 | return partition_; |
112 | 0 | } |
113 | | |
114 | | /** |
115 | | * Setter for PartitionQosPolicy |
116 | | * |
117 | | * @param partition PartitionQosPolicy |
118 | | */ |
119 | | void partition( |
120 | | const PartitionQosPolicy& partition) |
121 | 0 | { |
122 | 0 | partition_ = partition; |
123 | 0 | } |
124 | | |
125 | | /** |
126 | | * Getter for GroupDataQosPolicy |
127 | | * |
128 | | * @return GroupDataQosPolicy reference |
129 | | */ |
130 | | const GroupDataQosPolicy& group_data() const |
131 | 0 | { |
132 | 0 | return group_data_; |
133 | 0 | } |
134 | | |
135 | | /** |
136 | | * Getter for GroupDataQosPolicy |
137 | | * |
138 | | * @return GroupDataQosPolicy reference |
139 | | */ |
140 | | GroupDataQosPolicy& group_data() |
141 | 0 | { |
142 | 0 | return group_data_; |
143 | 0 | } |
144 | | |
145 | | /** |
146 | | * Setter for GroupDataQosPolicy |
147 | | * |
148 | | * @param group_data GroupDataQosPolicy |
149 | | */ |
150 | | void group_data( |
151 | | const GroupDataQosPolicy& group_data) |
152 | 0 | { |
153 | 0 | group_data_ = group_data; |
154 | 0 | } |
155 | | |
156 | | /** |
157 | | * Getter for EntityFactoryQosPolicy |
158 | | * |
159 | | * @return EntityFactoryQosPolicy reference |
160 | | */ |
161 | | const EntityFactoryQosPolicy& entity_factory() const |
162 | 0 | { |
163 | 0 | return entity_factory_; |
164 | 0 | } |
165 | | |
166 | | /** |
167 | | * Getter for EntityFactoryQosPolicy |
168 | | * |
169 | | * @return EntityFactoryQosPolicy reference |
170 | | */ |
171 | | EntityFactoryQosPolicy& entity_factory() |
172 | 0 | { |
173 | 0 | return entity_factory_; |
174 | 0 | } |
175 | | |
176 | | /** |
177 | | * Setter for EntityFactoryQosPolicy |
178 | | * |
179 | | * @param entity_factory EntityFactoryQosPolicy |
180 | | */ |
181 | | void entity_factory( |
182 | | const EntityFactoryQosPolicy& entity_factory) |
183 | 0 | { |
184 | 0 | entity_factory_ = entity_factory; |
185 | 0 | } |
186 | | |
187 | | private: |
188 | | |
189 | | //!Presentation Qos, NOT implemented in the library. |
190 | | PresentationQosPolicy presentation_; |
191 | | |
192 | | //!Partition Qos, implemented in the library. |
193 | | PartitionQosPolicy partition_; |
194 | | |
195 | | //!Group Data Qos, implemented in the library. |
196 | | GroupDataQosPolicy group_data_; |
197 | | |
198 | | //!Entity Factory Qos, implemented in the library |
199 | | EntityFactoryQosPolicy entity_factory_; |
200 | | |
201 | | }; |
202 | | |
203 | | FASTDDS_EXPORTED_API extern const PublisherQos PUBLISHER_QOS_DEFAULT; |
204 | | |
205 | | } // namespace dds |
206 | | } // namespace fastdds |
207 | | } // namespace eprosima |
208 | | |
209 | | #endif // FASTDDS_DDS_PUBLISHER_QOS__PUBLISHERQOS_HPP |