/src/Fast-DDS/include/fastdds/dds/topic/qos/TopicQos.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 TopicQos.hpp |
17 | | */ |
18 | | |
19 | | |
20 | | #ifndef _FASTDDS_TOPICQOS_HPP |
21 | | #define _FASTDDS_TOPICQOS_HPP |
22 | | |
23 | | #include <fastdds/dds/core/policy/QosPolicies.hpp> |
24 | | #include <fastrtps/attributes/TopicAttributes.h> |
25 | | |
26 | | #include <fastdds/dds/log/Log.hpp> |
27 | | |
28 | | namespace eprosima { |
29 | | namespace fastdds { |
30 | | namespace dds { |
31 | | |
32 | | /** |
33 | | * Class TopicQos, containing all the possible Qos that can be set for a determined Topic. |
34 | | * Although these values can be set and are transmitted |
35 | | * during the Endpoint Discovery Protocol, not all of the behaviour associated with them has been implemented in the library. |
36 | | * Please consult each of them to check for implementation details and default values. |
37 | | * |
38 | | * @ingroup FASTDDS_QOS_MODULE |
39 | | */ |
40 | | class TopicQos |
41 | | { |
42 | | public: |
43 | | |
44 | | /** |
45 | | * @brief Constructor |
46 | | */ |
47 | | RTPS_DllAPI TopicQos(); |
48 | | |
49 | | bool operator ==( |
50 | | const TopicQos& b) const |
51 | 0 | { |
52 | 0 | return (this->topic_data_ == b.topic_data()) && |
53 | 0 | (this->durability_ == b.durability()) && |
54 | 0 | (this->durability_service_ == b.durability_service()) && |
55 | 0 | (this->deadline_ == b.deadline()) && |
56 | 0 | (this->latency_budget_ == b.latency_budget()) && |
57 | 0 | (this->liveliness_ == b.liveliness()) && |
58 | 0 | (this->reliability_ == b.reliability()) && |
59 | 0 | (this->destination_order_ == b.destination_order()) && |
60 | 0 | (this->history_ == b.history()) && |
61 | 0 | (this->resource_limits_ == b.resource_limits()) && |
62 | 0 | (this->transport_priority_ == b.transport_priority()) && |
63 | 0 | (this->lifespan_ == b.lifespan()) && |
64 | 0 | (this->ownership_ == b.ownership()); |
65 | 0 | } |
66 | | |
67 | | /** |
68 | | * Getter for TopicDataQosPolicy |
69 | | * |
70 | | * @return TopicDataQos reference |
71 | | */ |
72 | | const TopicDataQosPolicy& topic_data() const |
73 | 0 | { |
74 | 0 | return topic_data_; |
75 | 0 | } |
76 | | |
77 | | /** |
78 | | * Getter for TopicDataQosPolicy |
79 | | * |
80 | | * @return TopicDataQos reference |
81 | | */ |
82 | | TopicDataQosPolicy& topic_data() |
83 | 0 | { |
84 | 0 | return topic_data_; |
85 | 0 | } |
86 | | |
87 | | /** |
88 | | * Setter for TopicDataQosPolicy |
89 | | * |
90 | | * @param value new value for the TopicDataQosPolicy |
91 | | */ |
92 | | void topic_data( |
93 | | const TopicDataQosPolicy& value) |
94 | 0 | { |
95 | 0 | topic_data_ = value; |
96 | 0 | } |
97 | | |
98 | | /** |
99 | | * Getter for DurabilityQosPolicy |
100 | | * |
101 | | * @return DurabilityQos reference |
102 | | */ |
103 | | const DurabilityQosPolicy& durability() const |
104 | 0 | { |
105 | 0 | return durability_; |
106 | 0 | } |
107 | | |
108 | | /** |
109 | | * Getter for DurabilityQosPolicy |
110 | | * |
111 | | * @return DurabilityQos reference |
112 | | */ |
113 | | DurabilityQosPolicy& durability() |
114 | 0 | { |
115 | 0 | return durability_; |
116 | 0 | } |
117 | | |
118 | | /** |
119 | | * Setter for DurabilityQosPolicy |
120 | | * |
121 | | * @param durability new value for the DurabilityQosPolicy |
122 | | */ |
123 | | void durability( |
124 | | const DurabilityQosPolicy& durability) |
125 | 0 | { |
126 | 0 | durability_ = durability; |
127 | 0 | } |
128 | | |
129 | | /** |
130 | | * Getter for DurabilityServiceQosPolicy |
131 | | * |
132 | | * @return DurabilityServiceQos reference |
133 | | */ |
134 | | const DurabilityServiceQosPolicy& durability_service() const |
135 | 0 | { |
136 | 0 | return durability_service_; |
137 | 0 | } |
138 | | |
139 | | /** |
140 | | * Getter for DurabilityServiceQosPolicy |
141 | | * |
142 | | * @return DurabilityServiceQos reference |
143 | | */ |
144 | | DurabilityServiceQosPolicy& durability_service() |
145 | 0 | { |
146 | 0 | return durability_service_; |
147 | 0 | } |
148 | | |
149 | | /** |
150 | | * Setter for DurabilityServiceQosPolicy |
151 | | * |
152 | | * @param durability_service new value for the DurabilityServiceQosPolicy |
153 | | */ |
154 | | void durability_service( |
155 | | const DurabilityServiceQosPolicy& durability_service) |
156 | 0 | { |
157 | 0 | durability_service_ = durability_service; |
158 | 0 | } |
159 | | |
160 | | /** |
161 | | * Getter for DeadlineQosPolicy |
162 | | * |
163 | | * @return DeadlineQos reference |
164 | | */ |
165 | | const DeadlineQosPolicy& deadline() const |
166 | 0 | { |
167 | 0 | return deadline_; |
168 | 0 | } |
169 | | |
170 | | /** |
171 | | * Getter for DeadlineQosPolicy |
172 | | * |
173 | | * @return DeadlineQos reference |
174 | | */ |
175 | | DeadlineQosPolicy& deadline() |
176 | 0 | { |
177 | 0 | return deadline_; |
178 | 0 | } |
179 | | |
180 | | /** |
181 | | * Setter for DeadlineQosPolicy |
182 | | * |
183 | | * @param deadline new value for the DeadlineQosPolicy |
184 | | */ |
185 | | void deadline( |
186 | | const DeadlineQosPolicy& deadline) |
187 | 0 | { |
188 | 0 | deadline_ = deadline; |
189 | 0 | } |
190 | | |
191 | | /** |
192 | | * Getter for LatencyBudgetQosPolicy |
193 | | * |
194 | | * @return LatencyBudgetQos reference |
195 | | */ |
196 | | const LatencyBudgetQosPolicy& latency_budget() const |
197 | 0 | { |
198 | 0 | return latency_budget_; |
199 | 0 | } |
200 | | |
201 | | /** |
202 | | * Getter for LatencyBudgetQosPolicy |
203 | | * |
204 | | * @return LatencyBudgetQos reference |
205 | | */ |
206 | | LatencyBudgetQosPolicy& latency_budget() |
207 | 0 | { |
208 | 0 | return latency_budget_; |
209 | 0 | } |
210 | | |
211 | | /** |
212 | | * Setter for LatencyBudgetQosPolicy |
213 | | * |
214 | | * @param latency_budget new value for the LatencyBudgetQosPolicy |
215 | | */ |
216 | | void latency_budget( |
217 | | const LatencyBudgetQosPolicy& latency_budget) |
218 | 0 | { |
219 | 0 | latency_budget_ = latency_budget; |
220 | 0 | } |
221 | | |
222 | | /** |
223 | | * Getter for LivelinessQosPolicy |
224 | | * |
225 | | * @return LivelinessQos reference |
226 | | */ |
227 | | const LivelinessQosPolicy& liveliness() const |
228 | 0 | { |
229 | 0 | return liveliness_; |
230 | 0 | } |
231 | | |
232 | | /** |
233 | | * Getter for LivelinessQosPolicy |
234 | | * |
235 | | * @return LivelinessQos reference |
236 | | */ |
237 | | LivelinessQosPolicy& liveliness() |
238 | 0 | { |
239 | 0 | return liveliness_; |
240 | 0 | } |
241 | | |
242 | | /** |
243 | | * Setter for LivelinessQosPolicy |
244 | | * |
245 | | * @param liveliness new value for the LivelinessQosPolicy |
246 | | */ |
247 | | void liveliness( |
248 | | const LivelinessQosPolicy& liveliness) |
249 | 0 | { |
250 | 0 | liveliness_ = liveliness; |
251 | 0 | } |
252 | | |
253 | | /** |
254 | | * Getter for ReliabilityQosPolicy |
255 | | * |
256 | | * @return ReliabilityQos reference |
257 | | */ |
258 | | const ReliabilityQosPolicy& reliability() const |
259 | 0 | { |
260 | 0 | return reliability_; |
261 | 0 | } |
262 | | |
263 | | /** |
264 | | * Getter for ReliabilityQosPolicy |
265 | | * |
266 | | * @return ReliabilityQos reference |
267 | | */ |
268 | | ReliabilityQosPolicy& reliability() |
269 | 0 | { |
270 | 0 | return reliability_; |
271 | 0 | } |
272 | | |
273 | | /** |
274 | | * Setter for ReliabilityQosPolicy |
275 | | * |
276 | | * @param reliability new value for the ReliabilityQosPolicy |
277 | | */ |
278 | | void reliability( |
279 | | const ReliabilityQosPolicy& reliability) |
280 | 0 | { |
281 | 0 | reliability_ = reliability; |
282 | 0 | } |
283 | | |
284 | | /** |
285 | | * Getter for DestinationOrderQosPolicy |
286 | | * |
287 | | * @return DestinationOrderQos reference |
288 | | */ |
289 | | const DestinationOrderQosPolicy& destination_order() const |
290 | 0 | { |
291 | 0 | return destination_order_; |
292 | 0 | } |
293 | | |
294 | | /** |
295 | | * Getter for DestinationOrderQosPolicy |
296 | | * |
297 | | * @return DestinationOrderQos reference |
298 | | */ |
299 | | DestinationOrderQosPolicy& destination_order() |
300 | 0 | { |
301 | 0 | return destination_order_; |
302 | 0 | } |
303 | | |
304 | | /** |
305 | | * Setter for DestinationOrderQosPolicy |
306 | | * |
307 | | * @param destination_order new value for the DestinationOrderQosPolicy |
308 | | */ |
309 | | void destination_order( |
310 | | const DestinationOrderQosPolicy& destination_order) |
311 | 0 | { |
312 | 0 | destination_order_ = destination_order; |
313 | 0 | } |
314 | | |
315 | | /** |
316 | | * Getter for HistoryQosPolicy |
317 | | * |
318 | | * @return HistoryQos reference |
319 | | */ |
320 | | const HistoryQosPolicy& history() const |
321 | 0 | { |
322 | 0 | return history_; |
323 | 0 | } |
324 | | |
325 | | /** |
326 | | * Getter for HistoryQosPolicy |
327 | | * |
328 | | * @return HistoryQos reference |
329 | | */ |
330 | | HistoryQosPolicy& history() |
331 | 0 | { |
332 | 0 | return history_; |
333 | 0 | } |
334 | | |
335 | | /** |
336 | | * Setter for HistoryQosPolicy |
337 | | * |
338 | | * @param history new value for the HistoryQosPolicy |
339 | | */ |
340 | | void history( |
341 | | const HistoryQosPolicy& history) |
342 | 0 | { |
343 | 0 | history_ = history; |
344 | 0 | } |
345 | | |
346 | | /** |
347 | | * Getter for ResourceLimitsQosPolicy |
348 | | * |
349 | | * @return ResourceLimitsQos reference |
350 | | */ |
351 | | const ResourceLimitsQosPolicy& resource_limits() const |
352 | 0 | { |
353 | 0 | return resource_limits_; |
354 | 0 | } |
355 | | |
356 | | /** |
357 | | * Getter for ResourceLimitsQosPolicy |
358 | | * |
359 | | * @return ResourceLimitsQos reference |
360 | | */ |
361 | | ResourceLimitsQosPolicy& resource_limits() |
362 | 0 | { |
363 | 0 | return resource_limits_; |
364 | 0 | } |
365 | | |
366 | | /** |
367 | | * Setter for ResourceLimitsQosPolicy |
368 | | * |
369 | | * @param resource_limits new value for the ResourceLimitsQosPolicy |
370 | | */ |
371 | | void resource_limits( |
372 | | const ResourceLimitsQosPolicy& resource_limits) |
373 | 0 | { |
374 | 0 | resource_limits_ = resource_limits; |
375 | 0 | } |
376 | | |
377 | | /** |
378 | | * Getter for TransportPriorityQosPolicy |
379 | | * |
380 | | * @return TransportPriorityQos reference |
381 | | */ |
382 | | const TransportPriorityQosPolicy& transport_priority() const |
383 | 0 | { |
384 | 0 | return transport_priority_; |
385 | 0 | } |
386 | | |
387 | | /** |
388 | | * Getter for TransportPriorityQosPolicy |
389 | | * |
390 | | * @return TransportPriorityQos reference |
391 | | */ |
392 | | TransportPriorityQosPolicy& transport_priority() |
393 | 0 | { |
394 | 0 | return transport_priority_; |
395 | 0 | } |
396 | | |
397 | | /** |
398 | | * Setter for TransportPriorityQosPolicy |
399 | | * |
400 | | * @param transport_priority new value for the TransportPriorityQosPolicy |
401 | | */ |
402 | | void transport_priority( |
403 | | const TransportPriorityQosPolicy& transport_priority) |
404 | 0 | { |
405 | 0 | transport_priority_ = transport_priority; |
406 | 0 | } |
407 | | |
408 | | /** |
409 | | * Getter for LifespanQosPolicy |
410 | | * |
411 | | * @return LifespanQos reference |
412 | | */ |
413 | | const LifespanQosPolicy& lifespan() const |
414 | 0 | { |
415 | 0 | return lifespan_; |
416 | 0 | } |
417 | | |
418 | | /** |
419 | | * Getter for LifespanQosPolicy |
420 | | * |
421 | | * @return LifespanQos reference |
422 | | */ |
423 | | LifespanQosPolicy& lifespan() |
424 | 0 | { |
425 | 0 | return lifespan_; |
426 | 0 | } |
427 | | |
428 | | /** |
429 | | * Setter for LifespanQosPolicy |
430 | | * |
431 | | * @param lifespan new value for the LifespanQosPolicy |
432 | | */ |
433 | | void lifespan( |
434 | | const LifespanQosPolicy& lifespan) |
435 | 0 | { |
436 | 0 | lifespan_ = lifespan; |
437 | 0 | } |
438 | | |
439 | | /** |
440 | | * Getter for OwnershipQosPolicy |
441 | | * |
442 | | * @return OwnershipQos reference |
443 | | */ |
444 | | const OwnershipQosPolicy& ownership() const |
445 | 0 | { |
446 | 0 | return ownership_; |
447 | 0 | } |
448 | | |
449 | | /** |
450 | | * Getter for OwnershipQosPolicy |
451 | | * |
452 | | * @return OwnershipQos reference |
453 | | */ |
454 | | OwnershipQosPolicy& ownership() |
455 | 0 | { |
456 | 0 | return ownership_; |
457 | 0 | } |
458 | | |
459 | | /** |
460 | | * Setter for OwnershipQosPolicy |
461 | | * |
462 | | * @param ownership new value for the OwnershipQosPolicy |
463 | | */ |
464 | | void ownership( |
465 | | const OwnershipQosPolicy& ownership) |
466 | 0 | { |
467 | 0 | ownership_ = ownership; |
468 | 0 | } |
469 | | |
470 | | /** |
471 | | * Getter for DataRepresentationQosPolicy |
472 | | * |
473 | | * @return DataRepresentationQosPolicy reference |
474 | | */ |
475 | | const DataRepresentationQosPolicy& representation() const |
476 | 0 | { |
477 | 0 | return representation_; |
478 | 0 | } |
479 | | |
480 | | /** |
481 | | * Getter for DataRepresentationQosPolicy |
482 | | * |
483 | | * @return DataRepresentationQosPolicy reference |
484 | | */ |
485 | | DataRepresentationQosPolicy& representation() |
486 | 0 | { |
487 | 0 | return representation_; |
488 | 0 | } |
489 | | |
490 | | /** |
491 | | * Setter for DataRepresentationQosPolicy |
492 | | * |
493 | | * @param representation new value for the DataRepresentationQosPolicy |
494 | | */ |
495 | | void representation( |
496 | | const DataRepresentationQosPolicy& representation) |
497 | 0 | { |
498 | 0 | representation_ = representation; |
499 | 0 | } |
500 | | |
501 | | private: |
502 | | |
503 | | //!Topic Data Qos, NOT implemented in the library. |
504 | | TopicDataQosPolicy topic_data_; |
505 | | |
506 | | //!Durability Qos, implemented in the library. |
507 | | DurabilityQosPolicy durability_; |
508 | | |
509 | | //!Durability Service Qos, NOT implemented in the library. |
510 | | DurabilityServiceQosPolicy durability_service_; |
511 | | |
512 | | //!Deadline Qos, implemented in the library. |
513 | | DeadlineQosPolicy deadline_; |
514 | | |
515 | | //!Latency Budget Qos, NOT implemented in the library. |
516 | | LatencyBudgetQosPolicy latency_budget_; |
517 | | |
518 | | //!Liveliness Qos, implemented in the library. |
519 | | LivelinessQosPolicy liveliness_; |
520 | | |
521 | | //!Reliability Qos, implemented in the library. |
522 | | ReliabilityQosPolicy reliability_; |
523 | | |
524 | | //!Destination Order Qos, NOT implemented in the library. |
525 | | DestinationOrderQosPolicy destination_order_; |
526 | | |
527 | | //!History Qos, implemented in the library. |
528 | | HistoryQosPolicy history_; |
529 | | |
530 | | //!Resource Limits Qos, implemented in the library. |
531 | | ResourceLimitsQosPolicy resource_limits_; |
532 | | |
533 | | //!Transport Priority Qos, NOT implemented in the library. |
534 | | TransportPriorityQosPolicy transport_priority_; |
535 | | |
536 | | //!Lifespan Qos, implemented in the library. |
537 | | LifespanQosPolicy lifespan_; |
538 | | |
539 | | //!Ownership Qos, NOT implemented in the library. |
540 | | OwnershipQosPolicy ownership_; |
541 | | |
542 | | //!Data Representation Qos, (XTypes extension). |
543 | | DataRepresentationQosPolicy representation_; |
544 | | }; |
545 | | |
546 | | RTPS_DllAPI extern const TopicQos TOPIC_QOS_DEFAULT; |
547 | | |
548 | | } // namespace dds |
549 | | } // namespace fastdds |
550 | | } // namespace eprosima |
551 | | |
552 | | #endif // _FASTDDS_TOPICQOS_HPP |