Line data Source code
1 : /*
2 : *
3 : *
4 : * Distributed under the OpenDDS License.
5 : * See: http://www.opendds.org/license.html
6 : */
7 :
8 : #ifndef OPENDDS_DCPS_QOS_HELPER_H
9 : #define OPENDDS_DCPS_QOS_HELPER_H
10 :
11 : #include "dds/DdsDcpsInfrastructureC.h"
12 : #include "dds/DdsDcpsPublicationC.h"
13 : #include "dds/DdsDcpsSubscriptionC.h"
14 : #include "dds/DdsDcpsTopicC.h"
15 : #include "Time_Helper.h"
16 :
17 : #if !defined (ACE_LACKS_PRAGMA_ONCE)
18 : #pragma once
19 : #endif /* ACE_LACKS_PRAGMA_ONCE */
20 :
21 : OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL
22 :
23 : namespace OpenDDS {
24 : namespace DCPS {
25 :
26 : /**
27 : * @class Qos_Helper
28 : *
29 : * @brief This class implements methods that verify whether a qos is
30 : * valid, consistent and changeable.
31 : *
32 : * valid - the values are in acceptable ranges without respect
33 : * to any other values.
34 : *
35 : * consistent - the values are consistent with each other.
36 : * The spec sometimes calls this "compatible" but I
37 : * this compatible should be reserved for matching
38 : * QoS of subscriptions and publications.
39 : * The spec is confusing in its inconsistency of the
40 : * use of "compatible" and "consistent".
41 : *
42 : * The qos supported in current implementation:
43 : * Liveliness : kind = AUTOMATIC
44 : * Reliability : kind = RELIABLE | BEST_EFFORT
45 : * max_blocking_time
46 : * History : kind = KEEP_ALL | KEEP_LAST
47 : * depth > 1
48 : * RESOURCE_LIMITS : max_samples_per_instance
49 : *
50 : * Other than these supported qos, any qos that is different from the
51 : * initial value is invalid.
52 : *
53 : * @note Since in the first implementation of DSS in TAO a limited
54 : * number of QoS values are allowed to be modified, the
55 : * consistency test on QoS settings have not been
56 : * implemented to check future "valid" QoS values.
57 : *
58 : * @note None of the supported QoS in the first implementation are
59 : * changeable. The changed value will be checked per the QoS
60 : * table in the DDS specification.
61 : */
62 : class OpenDDS_Dcps_Export Qos_Helper {
63 : public:
64 :
65 : static bool consistent(
66 : const DDS::ResourceLimitsQosPolicy& resource_limits,
67 : const DDS::HistoryQosPolicy& history);
68 :
69 : static bool consistent(
70 : const DDS::DeadlineQosPolicy& deadline,
71 : const DDS::TimeBasedFilterQosPolicy& time_based_filter);
72 :
73 : static bool consistent(const DDS::DomainParticipantQos& qos);
74 :
75 : static bool consistent(const DDS::TopicQos& qos);
76 :
77 : static bool consistent(const DDS::DataWriterQos& qos);
78 :
79 : static bool consistent(const DDS::PublisherQos& qos);
80 :
81 : static bool consistent(const DDS::DataReaderQos& qos);
82 :
83 : static bool consistent(const DDS::SubscriberQos& qos);
84 :
85 : static bool consistent(const DDS::DomainParticipantFactoryQos & qos);
86 :
87 : static bool valid(const DDS::UserDataQosPolicy& qos);
88 :
89 : static bool valid(const DDS::TopicDataQosPolicy & qos);
90 :
91 : static bool valid(const DDS::GroupDataQosPolicy& qos);
92 :
93 : static bool valid(const DDS::TransportPriorityQosPolicy& qos);
94 :
95 : static bool valid(const DDS::LifespanQosPolicy& qos);
96 :
97 : static bool valid(const DDS::DurabilityQosPolicy& qos);
98 :
99 : #ifndef OPENDDS_NO_PERSISTENCE_PROFILE
100 : static bool valid(const DDS::DurabilityServiceQosPolicy& qos);
101 : #endif
102 :
103 : static bool valid(const DDS::PresentationQosPolicy& qos);
104 :
105 : static bool valid(const DDS::DeadlineQosPolicy& qos);
106 :
107 : static bool valid(const DDS::LatencyBudgetQosPolicy& qos);
108 :
109 : static bool valid(const DDS::OwnershipQosPolicy& qos);
110 :
111 : #ifndef OPENDDS_NO_OWNERSHIP_KIND_EXCLUSIVE
112 : static bool valid(const DDS::OwnershipStrengthQosPolicy& qos);
113 : #endif
114 :
115 : static bool valid(const DDS::LivelinessQosPolicy& qos);
116 :
117 : static bool valid(const DDS::TimeBasedFilterQosPolicy& qos);
118 :
119 : static bool valid(const DDS::PartitionQosPolicy& qos);
120 :
121 : static bool valid(const DDS::ReliabilityQosPolicy& qos);
122 :
123 : static bool valid(const DDS::DestinationOrderQosPolicy& qos);
124 :
125 : static bool valid(const DDS::HistoryQosPolicy& qos);
126 :
127 : static bool valid(const DDS::ResourceLimitsQosPolicy& qos);
128 :
129 : static bool valid(const DDS::EntityFactoryQosPolicy& qos);
130 :
131 : static bool valid(const DDS::PropertyQosPolicy& qos);
132 :
133 : static bool valid(const DDS::WriterDataLifecycleQosPolicy& qos);
134 :
135 : static bool valid(const DDS::ReaderDataLifecycleQosPolicy& qos);
136 :
137 : static bool valid(const DDS::DomainParticipantQos& qos);
138 :
139 : static bool valid(const DDS::TopicQos& qos);
140 :
141 : static bool valid(const DDS::DataWriterQos& qos);
142 :
143 : static bool valid(const DDS::PublisherQos& qos);
144 :
145 : static bool valid(const DDS::DataReaderQos& qos);
146 :
147 : static bool valid(const DDS::SubscriberQos& qos);
148 :
149 : static bool valid(const DDS::DomainParticipantFactoryQos& qos);
150 :
151 : static bool valid(const DDS::DataRepresentationQosPolicy& qos);
152 :
153 : static bool changeable(const DDS::UserDataQosPolicy& qos1,
154 : const DDS::UserDataQosPolicy& qos2);
155 :
156 : static bool changeable(const DDS::TopicDataQosPolicy & qos1,
157 : const DDS::TopicDataQosPolicy & qos2);
158 :
159 : static bool changeable(const DDS::GroupDataQosPolicy& qos1,
160 : const DDS::GroupDataQosPolicy& qos2);
161 :
162 : static bool changeable(const DDS::TransportPriorityQosPolicy& qos1,
163 : const DDS::TransportPriorityQosPolicy& qos2);
164 :
165 : static bool changeable(const DDS::LifespanQosPolicy& qos1,
166 : const DDS::LifespanQosPolicy& qos2);
167 :
168 : static bool changeable(const DDS::DurabilityQosPolicy& qos1,
169 : const DDS::DurabilityQosPolicy& qos2);
170 :
171 : #ifndef OPENDDS_NO_PERSISTENCE_PROFILE
172 : static bool changeable(const DDS::DurabilityServiceQosPolicy& qos1,
173 : const DDS::DurabilityServiceQosPolicy& qos2);
174 : #endif
175 :
176 : static bool changeable(const DDS::PresentationQosPolicy& qos1,
177 : const DDS::PresentationQosPolicy& qos2);
178 :
179 : static bool changeable(const DDS::DeadlineQosPolicy& qos1,
180 : const DDS::DeadlineQosPolicy& qos2);
181 :
182 : static bool changeable(const DDS::LatencyBudgetQosPolicy& qos1,
183 : const DDS::LatencyBudgetQosPolicy& qos2);
184 :
185 : static bool changeable(const DDS::OwnershipQosPolicy& qos1,
186 : const DDS::OwnershipQosPolicy& qos2);
187 :
188 : #ifndef OPENDDS_NO_OWNERSHIP_KIND_EXCLUSIVE
189 : static bool changeable(const DDS::OwnershipStrengthQosPolicy& qos1,
190 : const DDS::OwnershipStrengthQosPolicy& qos2);
191 : #endif
192 :
193 : static bool changeable(const DDS::LivelinessQosPolicy& qos1,
194 : const DDS::LivelinessQosPolicy& qos2);
195 :
196 : static bool changeable(const DDS::TimeBasedFilterQosPolicy& qos1,
197 : const DDS::TimeBasedFilterQosPolicy& qos2);
198 :
199 : static bool changeable(const DDS::PartitionQosPolicy& qos1,
200 : const DDS::PartitionQosPolicy& qos2);
201 :
202 : static bool changeable(const DDS::ReliabilityQosPolicy& qos1,
203 : const DDS::ReliabilityQosPolicy& qos2);
204 :
205 : static bool changeable(const DDS::DestinationOrderQosPolicy& qos1,
206 : const DDS::DestinationOrderQosPolicy& qos2);
207 :
208 : static bool changeable(const DDS::HistoryQosPolicy& qos1,
209 : const DDS::HistoryQosPolicy& qos2);
210 :
211 : static bool changeable(const DDS::ResourceLimitsQosPolicy& qos1,
212 : const DDS::ResourceLimitsQosPolicy& qos2);
213 :
214 : static bool changeable(const DDS::EntityFactoryQosPolicy& qos1,
215 : const DDS::EntityFactoryQosPolicy& qos2) ;
216 :
217 : static bool changeable(const DDS::WriterDataLifecycleQosPolicy& qos1,
218 : const DDS::WriterDataLifecycleQosPolicy& qos2);
219 :
220 : static bool changeable(const DDS::ReaderDataLifecycleQosPolicy& qos1,
221 : const DDS::ReaderDataLifecycleQosPolicy& qos2);
222 :
223 : static bool changeable(const DDS::DomainParticipantQos& qos1,
224 : const DDS::DomainParticipantQos& qos2);
225 :
226 : static bool changeable(const DDS::TopicQos& qos1,
227 : const DDS::TopicQos& qos2);
228 :
229 : static bool changeable(const DDS::DataWriterQos& qos1,
230 : const DDS::DataWriterQos& qos2);
231 :
232 : static bool changeable(const DDS::PublisherQos& qos1,
233 : const DDS::PublisherQos& qos2);
234 :
235 : static bool changeable(const DDS::DataReaderQos& qos1,
236 : const DDS::DataReaderQos& qos2);
237 :
238 : static bool changeable(const DDS::SubscriberQos& qos1,
239 : const DDS::SubscriberQos& qos2);
240 :
241 : static bool changeable(const DDS::DomainParticipantFactoryQos& qos1,
242 : const DDS::DomainParticipantFactoryQos& qos2);
243 :
244 : static bool changeable(
245 : const DDS::DataRepresentationQosPolicy& qos1,
246 : const DDS::DataRepresentationQosPolicy& qos2);
247 :
248 : static bool copy_from_topic_qos(DDS::DataReaderQos& a_datareader_qos,
249 : const DDS::TopicQos& a_topic_qos);
250 :
251 : static bool copy_from_topic_qos(DDS::DataWriterQos& a_datareader_qos,
252 : const DDS::TopicQos& a_topic_qos);
253 : };
254 :
255 : #ifndef OPENDDS_SAFETY_PROFILE
256 : ACE_INLINE OpenDDS_Dcps_Export
257 : bool operator==(const DDS::UserDataQosPolicy& qos1,
258 : const DDS::UserDataQosPolicy& qos2);
259 :
260 : ACE_INLINE OpenDDS_Dcps_Export
261 : bool operator==(const DDS::TopicDataQosPolicy& qos1,
262 : const DDS::TopicDataQosPolicy& qos2);
263 :
264 : ACE_INLINE OpenDDS_Dcps_Export
265 : bool operator==(const DDS::GroupDataQosPolicy& qos1,
266 : const DDS::GroupDataQosPolicy& qos2);
267 :
268 : ACE_INLINE OpenDDS_Dcps_Export
269 : bool operator==(const DDS::TransportPriorityQosPolicy& qos1,
270 : const DDS::TransportPriorityQosPolicy& qos2);
271 :
272 : ACE_INLINE OpenDDS_Dcps_Export
273 : bool operator==(const DDS::LifespanQosPolicy& qos1,
274 : const DDS::LifespanQosPolicy& qos2);
275 :
276 : ACE_INLINE OpenDDS_Dcps_Export
277 : bool operator==(const DDS::DurabilityQosPolicy& qos1,
278 : const DDS::DurabilityQosPolicy& qos2);
279 :
280 : ACE_INLINE OpenDDS_Dcps_Export
281 : bool operator==(const DDS::DurabilityServiceQosPolicy& qos1,
282 : const DDS::DurabilityServiceQosPolicy& qos2);
283 :
284 : ACE_INLINE OpenDDS_Dcps_Export
285 : bool operator==(const DDS::PresentationQosPolicy& qos1,
286 : const DDS::PresentationQosPolicy& qos2);
287 :
288 : ACE_INLINE OpenDDS_Dcps_Export
289 : bool operator==(const DDS::DeadlineQosPolicy& qos1,
290 : const DDS::DeadlineQosPolicy& qos2);
291 :
292 : ACE_INLINE OpenDDS_Dcps_Export
293 : bool operator==(const DDS::LatencyBudgetQosPolicy& qos1,
294 : const DDS::LatencyBudgetQosPolicy& qos2);
295 :
296 : ACE_INLINE OpenDDS_Dcps_Export
297 : bool operator==(const DDS::OwnershipQosPolicy& qos1,
298 : const DDS::OwnershipQosPolicy& qos2);
299 :
300 : ACE_INLINE OpenDDS_Dcps_Export
301 : bool operator==(const DDS::OwnershipStrengthQosPolicy& qos1,
302 : const DDS::OwnershipStrengthQosPolicy& qos2);
303 :
304 : ACE_INLINE OpenDDS_Dcps_Export
305 : bool operator==(const DDS::LivelinessQosPolicy& qos1,
306 : const DDS::LivelinessQosPolicy& qos2);
307 :
308 : ACE_INLINE OpenDDS_Dcps_Export
309 : bool operator==(const DDS::TimeBasedFilterQosPolicy& qos1,
310 : const DDS::TimeBasedFilterQosPolicy& qos2);
311 :
312 : ACE_INLINE OpenDDS_Dcps_Export
313 : bool operator==(const DDS::PartitionQosPolicy& qos1,
314 : const DDS::PartitionQosPolicy& qos2);
315 :
316 : ACE_INLINE OpenDDS_Dcps_Export
317 : bool operator==(const DDS::ReliabilityQosPolicy& qos1,
318 : const DDS::ReliabilityQosPolicy& qos2);
319 :
320 : ACE_INLINE OpenDDS_Dcps_Export
321 : bool operator==(const DDS::DestinationOrderQosPolicy& qos1,
322 : const DDS::DestinationOrderQosPolicy& qos2);
323 :
324 : ACE_INLINE OpenDDS_Dcps_Export
325 : bool operator==(const DDS::HistoryQosPolicy& qos1,
326 : const DDS::HistoryQosPolicy& qos2);
327 :
328 : ACE_INLINE OpenDDS_Dcps_Export
329 : bool operator==(const DDS::ResourceLimitsQosPolicy& qos1,
330 : const DDS::ResourceLimitsQosPolicy& qos2);
331 :
332 : ACE_INLINE OpenDDS_Dcps_Export
333 : bool operator==(const DDS::EntityFactoryQosPolicy& qos1,
334 : const DDS::EntityFactoryQosPolicy& qos2);
335 :
336 : ACE_INLINE OpenDDS_Dcps_Export
337 : bool operator==(const DDS::WriterDataLifecycleQosPolicy& qos1,
338 : const DDS::WriterDataLifecycleQosPolicy& qos2);
339 :
340 : ACE_INLINE OpenDDS_Dcps_Export
341 : bool operator==(const DDS::ReaderDataLifecycleQosPolicy& qos1,
342 : const DDS::ReaderDataLifecycleQosPolicy& qos2);
343 :
344 : ACE_INLINE OpenDDS_Dcps_Export
345 : bool operator==(const DDS::DomainParticipantQos& qos1,
346 : const DDS::DomainParticipantQos& qos2);
347 :
348 : ACE_INLINE OpenDDS_Dcps_Export
349 : bool operator==(const DDS::TopicQos& qos1,
350 : const DDS::TopicQos& qos2);
351 :
352 : ACE_INLINE OpenDDS_Dcps_Export
353 : bool operator==(const DDS::DataWriterQos& qos1,
354 : const DDS::DataWriterQos& qos2);
355 :
356 : ACE_INLINE OpenDDS_Dcps_Export
357 : bool operator==(const DDS::PublisherQos& qos1,
358 : const DDS::PublisherQos& qos2);
359 :
360 : ACE_INLINE OpenDDS_Dcps_Export
361 : bool operator==(const DDS::DataReaderQos& qos1,
362 : const DDS::DataReaderQos& qos2);
363 :
364 : ACE_INLINE OpenDDS_Dcps_Export
365 : bool operator==(const DDS::SubscriberQos& qos1,
366 : const DDS::SubscriberQos& qos2);
367 :
368 : ACE_INLINE OpenDDS_Dcps_Export
369 : bool operator==(const DDS::DomainParticipantFactoryQos& qos1,
370 : const DDS::DomainParticipantFactoryQos& qos2);
371 :
372 : ACE_INLINE OpenDDS_Dcps_Export
373 : bool operator==(const DDS::DataRepresentationQosPolicy& qos1,
374 : const DDS::DataRepresentationQosPolicy& qos2);
375 :
376 : ACE_INLINE OpenDDS_Dcps_Export
377 : bool operator==(const DDS::TypeConsistencyEnforcementQosPolicy& qos1,
378 : const DDS::TypeConsistencyEnforcementQosPolicy& qos2);
379 :
380 : ACE_INLINE OpenDDS_Dcps_Export
381 : bool operator!=(const DDS::UserDataQosPolicy& qos1,
382 : const DDS::UserDataQosPolicy& qos2);
383 :
384 : ACE_INLINE OpenDDS_Dcps_Export
385 : bool operator!=(const DDS::TopicDataQosPolicy& qos1,
386 : const DDS::TopicDataQosPolicy& qos2);
387 :
388 : ACE_INLINE OpenDDS_Dcps_Export
389 : bool operator!=(const DDS::GroupDataQosPolicy& qos1,
390 : const DDS::GroupDataQosPolicy& qos2);
391 :
392 : ACE_INLINE OpenDDS_Dcps_Export
393 : bool operator!=(const DDS::TransportPriorityQosPolicy& qos1,
394 : const DDS::TransportPriorityQosPolicy& qos2);
395 :
396 : ACE_INLINE OpenDDS_Dcps_Export
397 : bool operator!=(const DDS::LifespanQosPolicy& qos1,
398 : const DDS::LifespanQosPolicy& qos2);
399 :
400 : ACE_INLINE OpenDDS_Dcps_Export
401 : bool operator!=(const DDS::DurabilityQosPolicy& qos1,
402 : const DDS::DurabilityQosPolicy& qos2);
403 :
404 : ACE_INLINE OpenDDS_Dcps_Export
405 : bool operator!=(const DDS::DurabilityServiceQosPolicy& qos1,
406 : const DDS::DurabilityServiceQosPolicy& qos2);
407 :
408 : ACE_INLINE OpenDDS_Dcps_Export
409 : bool operator!=(const DDS::PresentationQosPolicy& qos1,
410 : const DDS::PresentationQosPolicy& qos2);
411 :
412 : ACE_INLINE OpenDDS_Dcps_Export
413 : bool operator!=(const DDS::DeadlineQosPolicy& qos1,
414 : const DDS::DeadlineQosPolicy& qos2);
415 :
416 : ACE_INLINE OpenDDS_Dcps_Export
417 : bool operator!=(const DDS::LatencyBudgetQosPolicy& qos1,
418 : const DDS::LatencyBudgetQosPolicy& qos2);
419 :
420 : ACE_INLINE OpenDDS_Dcps_Export
421 : bool operator!=(const DDS::OwnershipQosPolicy& qos1,
422 : const DDS::OwnershipQosPolicy& qos2);
423 :
424 : ACE_INLINE OpenDDS_Dcps_Export
425 : bool operator!=(const DDS::OwnershipStrengthQosPolicy& qos1,
426 : const DDS::OwnershipStrengthQosPolicy& qos2);
427 :
428 : ACE_INLINE OpenDDS_Dcps_Export
429 : bool operator!=(const DDS::LivelinessQosPolicy& qos1,
430 : const DDS::LivelinessQosPolicy& qos2);
431 :
432 : ACE_INLINE OpenDDS_Dcps_Export
433 : bool operator!=(const DDS::TimeBasedFilterQosPolicy& qos1,
434 : const DDS::TimeBasedFilterQosPolicy& qos2);
435 :
436 : ACE_INLINE OpenDDS_Dcps_Export
437 : bool operator!=(const DDS::PartitionQosPolicy& qos1,
438 : const DDS::PartitionQosPolicy& qos2);
439 :
440 : ACE_INLINE OpenDDS_Dcps_Export
441 : bool operator!=(const DDS::ReliabilityQosPolicy& qos1,
442 : const DDS::ReliabilityQosPolicy& qos2);
443 :
444 : ACE_INLINE OpenDDS_Dcps_Export
445 : bool operator!=(const DDS::DestinationOrderQosPolicy& qos1,
446 : const DDS::DestinationOrderQosPolicy& qos2);
447 :
448 : ACE_INLINE OpenDDS_Dcps_Export
449 : bool operator!=(const DDS::HistoryQosPolicy& qos1,
450 : const DDS::HistoryQosPolicy& qos2);
451 :
452 : ACE_INLINE OpenDDS_Dcps_Export
453 : bool operator!=(const DDS::ResourceLimitsQosPolicy& qos1,
454 : const DDS::ResourceLimitsQosPolicy& qos2);
455 :
456 : ACE_INLINE OpenDDS_Dcps_Export
457 : bool operator!=(const DDS::EntityFactoryQosPolicy& qos1,
458 : const DDS::EntityFactoryQosPolicy& qos2);
459 :
460 : ACE_INLINE OpenDDS_Dcps_Export
461 : bool operator!=(const DDS::WriterDataLifecycleQosPolicy& qos1,
462 : const DDS::WriterDataLifecycleQosPolicy& qos2);
463 :
464 : ACE_INLINE OpenDDS_Dcps_Export
465 : bool operator!=(const DDS::ReaderDataLifecycleQosPolicy& qos1,
466 : const DDS::ReaderDataLifecycleQosPolicy& qos2);
467 :
468 : ACE_INLINE OpenDDS_Dcps_Export
469 : bool operator!=(const DDS::PropertyQosPolicy& qos1,
470 : const DDS::PropertyQosPolicy& qos2);
471 :
472 : ACE_INLINE OpenDDS_Dcps_Export
473 : bool operator!=(const DDS::DomainParticipantQos& qos1,
474 : const DDS::DomainParticipantQos& qos2);
475 :
476 : ACE_INLINE OpenDDS_Dcps_Export
477 : bool operator!=(const DDS::TopicQos& qos1,
478 : const DDS::TopicQos& qos2);
479 :
480 : ACE_INLINE OpenDDS_Dcps_Export
481 : bool operator!=(const DDS::DataWriterQos& qos1,
482 : const DDS::DataWriterQos& qos2);
483 :
484 : ACE_INLINE OpenDDS_Dcps_Export
485 : bool operator!=(const DDS::PublisherQos& qos1,
486 : const DDS::PublisherQos& qos2);
487 :
488 : ACE_INLINE OpenDDS_Dcps_Export
489 : bool operator!=(const DDS::DataReaderQos& qos1,
490 : const DDS::DataReaderQos& qos2);
491 :
492 : ACE_INLINE OpenDDS_Dcps_Export
493 : bool operator!=(const DDS::SubscriberQos& qos1,
494 : const DDS::SubscriberQos& qos2);
495 :
496 : ACE_INLINE OpenDDS_Dcps_Export
497 : bool operator!=(const DDS::DomainParticipantFactoryQos& qos1,
498 : const DDS::DomainParticipantFactoryQos& qos2);
499 :
500 : ACE_INLINE OpenDDS_Dcps_Export
501 : bool operator!=(const DDS::DataRepresentationQosPolicy& qos1,
502 : const DDS::DataRepresentationQosPolicy& qos2);
503 :
504 : ACE_INLINE OpenDDS_Dcps_Export
505 : bool operator!=(const DDS::TypeConsistencyEnforcementQosPolicy& qos1,
506 : const DDS::TypeConsistencyEnforcementQosPolicy& qos2);
507 : #endif
508 :
509 : class TransportPriorityQosPolicyBuilder {
510 : public:
511 120 : TransportPriorityQosPolicyBuilder()
512 120 : {
513 120 : qos_.value = 0;
514 120 : }
515 :
516 : const DDS::TransportPriorityQosPolicy& qos() const { return qos_; }
517 3 : DDS::TransportPriorityQosPolicy& qos() { return qos_; }
518 1 : operator const DDS::TransportPriorityQosPolicy&() const { return qos_; }
519 118 : operator DDS::TransportPriorityQosPolicy&() { return qos_; }
520 :
521 1 : TransportPriorityQosPolicyBuilder& value(int value)
522 : {
523 1 : qos_.value = value;
524 1 : return *this;
525 : }
526 :
527 : private:
528 : DDS::TransportPriorityQosPolicy qos_;
529 : };
530 :
531 : class LifespanQosPolicyBuilder {
532 : public:
533 120 : LifespanQosPolicyBuilder()
534 120 : {
535 120 : qos_.duration.sec = DDS::DURATION_INFINITE_SEC;
536 120 : qos_.duration.nanosec = DDS::DURATION_INFINITE_NSEC;
537 120 : }
538 :
539 : const DDS::LifespanQosPolicy& qos() const { return qos_; }
540 3 : DDS::LifespanQosPolicy& qos() { return qos_; }
541 1 : operator const DDS::LifespanQosPolicy&() const { return qos_; }
542 118 : operator DDS::LifespanQosPolicy&() { return qos_; }
543 :
544 1 : LifespanQosPolicyBuilder& duration(const DDS::Duration_t& duration)
545 : {
546 1 : qos_.duration = duration;
547 1 : return *this;
548 : }
549 :
550 : private:
551 : DDS::LifespanQosPolicy qos_;
552 : };
553 :
554 : class DurabilityQosPolicyBuilder {
555 : public:
556 200 : DurabilityQosPolicyBuilder()
557 200 : {
558 200 : qos_.kind = DDS::VOLATILE_DURABILITY_QOS;
559 200 : }
560 :
561 : const DDS::DurabilityQosPolicy& qos() const { return qos_; }
562 7 : DDS::DurabilityQosPolicy& qos() { return qos_; }
563 1 : operator const DDS::DurabilityQosPolicy&() const { return qos_; }
564 194 : operator DDS::DurabilityQosPolicy&() { return qos_; }
565 :
566 1 : DurabilityQosPolicyBuilder& kind(DDS::DurabilityQosPolicyKind kind)
567 : {
568 1 : qos_.kind = kind;
569 1 : return *this;
570 : }
571 :
572 1 : DurabilityQosPolicyBuilder& _volatile()
573 : {
574 1 : qos_.kind = DDS::VOLATILE_DURABILITY_QOS;
575 1 : return *this;
576 : }
577 :
578 1 : DurabilityQosPolicyBuilder& transient_local()
579 : {
580 1 : qos_.kind = DDS::TRANSIENT_LOCAL_DURABILITY_QOS;
581 1 : return *this;
582 : }
583 :
584 1 : DurabilityQosPolicyBuilder& transient()
585 : {
586 1 : qos_.kind = DDS::TRANSIENT_DURABILITY_QOS;
587 1 : return *this;
588 : }
589 :
590 1 : DurabilityQosPolicyBuilder& persistent()
591 : {
592 1 : qos_.kind = DDS::PERSISTENT_DURABILITY_QOS;
593 1 : return *this;
594 : }
595 :
596 : private:
597 : DDS::DurabilityQosPolicy qos_;
598 : };
599 :
600 : class DurabilityServiceQosPolicyBuilder {
601 : public:
602 127 : DurabilityServiceQosPolicyBuilder()
603 127 : {
604 127 : qos_.service_cleanup_delay.sec = DDS::DURATION_ZERO_SEC;
605 127 : qos_.service_cleanup_delay.nanosec = DDS::DURATION_ZERO_NSEC;
606 127 : qos_.history_kind = DDS::KEEP_LAST_HISTORY_QOS;
607 127 : qos_.history_depth = 1;
608 127 : qos_.max_samples = DDS::LENGTH_UNLIMITED;
609 127 : qos_.max_instances = DDS::LENGTH_UNLIMITED;
610 127 : qos_.max_samples_per_instance = DDS::LENGTH_UNLIMITED;
611 127 : }
612 :
613 : const DDS::DurabilityServiceQosPolicy& qos() const { return qos_; }
614 16 : DDS::DurabilityServiceQosPolicy& qos() { return qos_; }
615 1 : operator const DDS::DurabilityServiceQosPolicy&() const { return qos_; }
616 118 : operator DDS::DurabilityServiceQosPolicy&() { return qos_; }
617 :
618 1 : DurabilityServiceQosPolicyBuilder& service_cleanup_delay(const DDS::Duration_t& delay)
619 : {
620 1 : qos_.service_cleanup_delay = delay;
621 1 : return *this;
622 : }
623 :
624 1 : DurabilityServiceQosPolicyBuilder& history_kind(DDS::HistoryQosPolicyKind kind)
625 : {
626 1 : qos_.history_kind = kind;
627 1 : return *this;
628 : }
629 :
630 1 : DurabilityServiceQosPolicyBuilder& keep_last(int depth)
631 : {
632 1 : qos_.history_kind = DDS::KEEP_LAST_HISTORY_QOS;
633 1 : qos_.history_depth = depth;
634 1 : return *this;
635 : }
636 :
637 1 : DurabilityServiceQosPolicyBuilder& keep_all()
638 : {
639 1 : qos_.history_kind = DDS::KEEP_ALL_HISTORY_QOS;
640 1 : return *this;
641 : }
642 :
643 1 : DurabilityServiceQosPolicyBuilder& history_depth(int depth)
644 : {
645 1 : qos_.history_depth = depth;
646 1 : return *this;
647 : }
648 :
649 1 : DurabilityServiceQosPolicyBuilder& max_samples(int value)
650 : {
651 1 : qos_.max_samples = value;
652 1 : return *this;
653 : }
654 :
655 1 : DurabilityServiceQosPolicyBuilder& max_instances(int value)
656 : {
657 1 : qos_.max_instances = value;
658 1 : return *this;
659 : }
660 :
661 1 : DurabilityServiceQosPolicyBuilder& max_samples_per_instance(int value)
662 : {
663 1 : qos_.max_samples_per_instance = value;
664 1 : return *this;
665 : }
666 :
667 : private:
668 : DDS::DurabilityServiceQosPolicy qos_;
669 : };
670 :
671 : class DeadlineQosPolicyBuilder {
672 : public:
673 196 : DeadlineQosPolicyBuilder()
674 196 : {
675 196 : qos_.period.sec = DDS::DURATION_INFINITE_SEC;
676 196 : qos_.period.nanosec = DDS::DURATION_INFINITE_NSEC;
677 196 : }
678 :
679 : const DDS::DeadlineQosPolicy& qos() const { return qos_; }
680 3 : DDS::DeadlineQosPolicy& qos() { return qos_; }
681 1 : operator const DDS::DeadlineQosPolicy&() const { return qos_; }
682 194 : operator DDS::DeadlineQosPolicy&() { return qos_; }
683 :
684 1 : DeadlineQosPolicyBuilder& period(const DDS::Duration_t& period)
685 : {
686 1 : qos_.period = period;
687 1 : return *this;
688 : }
689 :
690 : private:
691 : DDS::DeadlineQosPolicy qos_;
692 : };
693 :
694 : class LatencyBudgetQosPolicyBuilder {
695 : public:
696 196 : LatencyBudgetQosPolicyBuilder()
697 196 : {
698 196 : qos_.duration.sec = DDS::DURATION_ZERO_SEC;
699 196 : qos_.duration.nanosec = DDS::DURATION_ZERO_NSEC;
700 196 : }
701 :
702 : const DDS::LatencyBudgetQosPolicy& qos() const { return qos_; }
703 3 : DDS::LatencyBudgetQosPolicy& qos() { return qos_; }
704 1 : operator const DDS::LatencyBudgetQosPolicy&() const { return qos_; }
705 194 : operator DDS::LatencyBudgetQosPolicy&() { return qos_; }
706 :
707 1 : LatencyBudgetQosPolicyBuilder& duration(const DDS::Duration_t& duration)
708 : {
709 1 : qos_.duration = duration;
710 1 : return *this;
711 : }
712 :
713 : private:
714 : DDS::LatencyBudgetQosPolicy qos_;
715 : };
716 :
717 : class OwnershipQosPolicyBuilder {
718 : public:
719 198 : OwnershipQosPolicyBuilder()
720 198 : {
721 198 : qos_.kind = DDS::SHARED_OWNERSHIP_QOS;
722 198 : }
723 :
724 : const DDS::OwnershipQosPolicy& qos() const { return qos_; }
725 5 : DDS::OwnershipQosPolicy& qos() { return qos_; }
726 1 : operator const DDS::OwnershipQosPolicy&() const { return qos_; }
727 194 : operator DDS::OwnershipQosPolicy&() { return qos_; }
728 :
729 1 : OwnershipQosPolicyBuilder& kind(DDS::OwnershipQosPolicyKind kind)
730 : {
731 1 : qos_.kind = kind;
732 1 : return *this;
733 : }
734 :
735 1 : OwnershipQosPolicyBuilder& shared()
736 : {
737 1 : qos_.kind = DDS::SHARED_OWNERSHIP_QOS;
738 1 : return *this;
739 : }
740 :
741 1 : OwnershipQosPolicyBuilder& exclusive()
742 : {
743 1 : qos_.kind = DDS::EXCLUSIVE_OWNERSHIP_QOS;
744 1 : return *this;
745 : }
746 :
747 : private:
748 : DDS::OwnershipQosPolicy qos_;
749 : };
750 :
751 : class OwnershipStrengthQosPolicyBuilder {
752 : public:
753 75 : OwnershipStrengthQosPolicyBuilder()
754 75 : {
755 75 : qos_.value = 0;
756 75 : }
757 :
758 : const DDS::OwnershipStrengthQosPolicy& qos() const { return qos_; }
759 3 : DDS::OwnershipStrengthQosPolicy& qos() { return qos_; }
760 1 : operator const DDS::OwnershipStrengthQosPolicy&() const { return qos_; }
761 73 : operator DDS::OwnershipStrengthQosPolicy&() { return qos_; }
762 :
763 1 : OwnershipStrengthQosPolicyBuilder& value(int value)
764 : {
765 1 : qos_.value = value;
766 1 : return *this;
767 : }
768 :
769 : private:
770 : DDS::OwnershipStrengthQosPolicy qos_;
771 : };
772 :
773 : class LivelinessQosPolicyBuilder {
774 : public:
775 200 : LivelinessQosPolicyBuilder()
776 200 : {
777 200 : qos_.kind = DDS::AUTOMATIC_LIVELINESS_QOS;
778 200 : qos_.lease_duration.sec = DDS::DURATION_INFINITE_SEC;
779 200 : qos_.lease_duration.nanosec = DDS::DURATION_INFINITE_NSEC;
780 200 : }
781 :
782 : const DDS::LivelinessQosPolicy& qos() const { return qos_; }
783 7 : DDS::LivelinessQosPolicy& qos() { return qos_; }
784 1 : operator const DDS::LivelinessQosPolicy&() const { return qos_; }
785 194 : operator DDS::LivelinessQosPolicy&() { return qos_; }
786 :
787 1 : LivelinessQosPolicyBuilder& kind(DDS::LivelinessQosPolicyKind kind)
788 : {
789 1 : qos_.kind = kind;
790 1 : return *this;
791 : }
792 :
793 1 : LivelinessQosPolicyBuilder& automatic()
794 : {
795 1 : qos_.kind = DDS::AUTOMATIC_LIVELINESS_QOS;
796 1 : return *this;
797 : }
798 :
799 1 : LivelinessQosPolicyBuilder& manual_by_participant()
800 : {
801 1 : qos_.kind = DDS::MANUAL_BY_PARTICIPANT_LIVELINESS_QOS;
802 1 : return *this;
803 : }
804 :
805 1 : LivelinessQosPolicyBuilder& manual_by_topic()
806 : {
807 1 : qos_.kind = DDS::MANUAL_BY_TOPIC_LIVELINESS_QOS;
808 1 : return *this;
809 : }
810 :
811 1 : LivelinessQosPolicyBuilder& lease_duration(const DDS::Duration_t& duration)
812 : {
813 1 : qos_.lease_duration = duration;
814 1 : return *this;
815 : }
816 :
817 : private:
818 : DDS::LivelinessQosPolicy qos_;
819 : };
820 :
821 : class TimeBasedFilterQosPolicyBuilder {
822 : public:
823 80 : TimeBasedFilterQosPolicyBuilder()
824 80 : {
825 80 : qos_.minimum_separation.sec = DDS::DURATION_ZERO_SEC;
826 80 : qos_.minimum_separation.nanosec = DDS::DURATION_ZERO_NSEC;
827 80 : }
828 :
829 : const DDS::TimeBasedFilterQosPolicy& qos() const { return qos_; }
830 2 : DDS::TimeBasedFilterQosPolicy& qos() { return qos_; }
831 1 : operator const DDS::TimeBasedFilterQosPolicy&() const { return qos_; }
832 78 : operator DDS::TimeBasedFilterQosPolicy&() { return qos_; }
833 :
834 1 : TimeBasedFilterQosPolicyBuilder& minimum_separation(const DDS::Duration_t& duration)
835 : {
836 1 : qos_.minimum_separation = duration;
837 1 : return *this;
838 : }
839 :
840 : private:
841 : DDS::TimeBasedFilterQosPolicy qos_;
842 : };
843 :
844 : class ReliabilityQosPolicyBuilder {
845 : public:
846 195 : ReliabilityQosPolicyBuilder()
847 195 : {
848 195 : qos_.kind = DDS::BEST_EFFORT_RELIABILITY_QOS;
849 : // TODO: According to the spec, this should be:
850 : // qos_.max_blocking_time.sec = 0;
851 : // qos_.max_blocking_time.nanosec = 100000000;
852 : // Change this at the next major release.
853 195 : qos_.max_blocking_time.sec = DDS::DURATION_INFINITE_SEC;
854 195 : qos_.max_blocking_time.nanosec = DDS::DURATION_INFINITE_NSEC;
855 195 : }
856 :
857 : const DDS::ReliabilityQosPolicy& qos() const { return qos_; }
858 : DDS::ReliabilityQosPolicy& qos() { return qos_; }
859 : operator const DDS::ReliabilityQosPolicy&() const { return qos_; }
860 195 : operator DDS::ReliabilityQosPolicy&() { return qos_; }
861 :
862 : ReliabilityQosPolicyBuilder& kind(DDS::ReliabilityQosPolicyKind kind)
863 : {
864 : qos_.kind = kind;
865 : return *this;
866 : }
867 :
868 : ReliabilityQosPolicyBuilder& best_effort()
869 : {
870 : qos_.kind = DDS::BEST_EFFORT_RELIABILITY_QOS;
871 : return *this;
872 : }
873 :
874 71 : ReliabilityQosPolicyBuilder& reliable()
875 : {
876 71 : qos_.kind = DDS::RELIABLE_RELIABILITY_QOS;
877 71 : return *this;
878 : }
879 :
880 71 : ReliabilityQosPolicyBuilder& max_blocking_time(const DDS::Duration_t& duration)
881 : {
882 71 : qos_.max_blocking_time = duration;
883 71 : return *this;
884 : }
885 :
886 : private:
887 : DDS::ReliabilityQosPolicy qos_;
888 : };
889 :
890 : class DestinationOrderQosPolicyBuilder {
891 : public:
892 193 : DestinationOrderQosPolicyBuilder()
893 193 : {
894 193 : qos_.kind = DDS::BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS;
895 193 : }
896 :
897 : const DDS::DestinationOrderQosPolicy& qos() const { return qos_; }
898 : DDS::DestinationOrderQosPolicy& qos() { return qos_; }
899 : operator const DDS::DestinationOrderQosPolicy&() const { return qos_; }
900 193 : operator DDS::DestinationOrderQosPolicy&() { return qos_; }
901 :
902 : DestinationOrderQosPolicyBuilder& kind(DDS::DestinationOrderQosPolicyKind kind)
903 : {
904 : qos_.kind = kind;
905 : return *this;
906 : }
907 :
908 : DestinationOrderQosPolicyBuilder& by_reception_timestamp()
909 : {
910 : qos_.kind = DDS::BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS;
911 : return *this;
912 : }
913 :
914 : DestinationOrderQosPolicyBuilder& by_source_timestamp()
915 : {
916 : qos_.kind = DDS::BY_SOURCE_TIMESTAMP_DESTINATIONORDER_QOS;
917 : return *this;
918 : }
919 :
920 : private:
921 : DDS::DestinationOrderQosPolicy qos_;
922 : };
923 :
924 : class HistoryQosPolicyBuilder {
925 : public:
926 193 : HistoryQosPolicyBuilder()
927 193 : {
928 193 : qos_.kind = DDS::KEEP_LAST_HISTORY_QOS;
929 193 : qos_.depth = 1;
930 193 : }
931 :
932 : const DDS::HistoryQosPolicy& qos() const { return qos_; }
933 : DDS::HistoryQosPolicy& qos() { return qos_; }
934 : operator const DDS::HistoryQosPolicy&() const { return qos_; }
935 193 : operator DDS::HistoryQosPolicy&() { return qos_; }
936 :
937 : HistoryQosPolicyBuilder& kind(DDS::HistoryQosPolicyKind kind)
938 : {
939 : qos_.kind = kind;
940 : return *this;
941 : }
942 :
943 : HistoryQosPolicyBuilder& keep_last(int depth)
944 : {
945 : qos_.kind = DDS::KEEP_LAST_HISTORY_QOS;
946 : qos_.depth = depth;
947 : return *this;
948 : }
949 :
950 : HistoryQosPolicyBuilder& keep_all()
951 : {
952 : qos_.kind = DDS::KEEP_ALL_HISTORY_QOS;
953 : return *this;
954 : }
955 :
956 : HistoryQosPolicyBuilder& depth(int depth)
957 : {
958 : qos_.depth = depth;
959 : return *this;
960 : }
961 :
962 : private:
963 : DDS::HistoryQosPolicy qos_;
964 : };
965 :
966 : class ResourceLimitsQosPolicyBuilder {
967 : public:
968 198 : ResourceLimitsQosPolicyBuilder()
969 198 : {
970 198 : qos_.max_samples = DDS::LENGTH_UNLIMITED;
971 198 : qos_.max_instances = DDS::LENGTH_UNLIMITED;
972 198 : qos_.max_samples_per_instance = DDS::LENGTH_UNLIMITED;
973 198 : }
974 :
975 : const DDS::ResourceLimitsQosPolicy& qos() const { return qos_; }
976 7 : DDS::ResourceLimitsQosPolicy& qos() { return qos_; }
977 1 : operator const DDS::ResourceLimitsQosPolicy&() const { return qos_; }
978 194 : operator DDS::ResourceLimitsQosPolicy&() { return qos_; }
979 :
980 1 : ResourceLimitsQosPolicyBuilder& max_samples(int value)
981 : {
982 1 : qos_.max_samples = value;
983 1 : return *this;
984 : }
985 :
986 1 : ResourceLimitsQosPolicyBuilder& max_instances(int value)
987 : {
988 1 : qos_.max_instances = value;
989 1 : return *this;
990 : }
991 :
992 1 : ResourceLimitsQosPolicyBuilder& max_samples_per_instance(int value)
993 : {
994 1 : qos_.max_samples_per_instance = value;
995 1 : return *this;
996 : }
997 :
998 : private:
999 : DDS::ResourceLimitsQosPolicy qos_;
1000 : };
1001 :
1002 : class WriterDataLifecycleQosPolicyBuilder {
1003 : public:
1004 75 : WriterDataLifecycleQosPolicyBuilder()
1005 75 : {
1006 75 : qos_.autodispose_unregistered_instances = true;
1007 75 : }
1008 :
1009 : const DDS::WriterDataLifecycleQosPolicy& qos() const { return qos_; }
1010 3 : DDS::WriterDataLifecycleQosPolicy& qos() { return qos_; }
1011 1 : operator const DDS::WriterDataLifecycleQosPolicy&() const { return qos_; }
1012 73 : operator DDS::WriterDataLifecycleQosPolicy&() { return qos_; }
1013 :
1014 1 : WriterDataLifecycleQosPolicyBuilder& autodispose_unregistered_instances(bool value)
1015 : {
1016 1 : qos_.autodispose_unregistered_instances = value;
1017 1 : return *this;
1018 : }
1019 :
1020 : private:
1021 : DDS::WriterDataLifecycleQosPolicy qos_;
1022 : };
1023 :
1024 : class ReaderDataLifecycleQosPolicyBuilder {
1025 : public:
1026 80 : ReaderDataLifecycleQosPolicyBuilder()
1027 80 : {
1028 80 : qos_.autopurge_nowriter_samples_delay.sec = DDS::DURATION_INFINITE_SEC;
1029 80 : qos_.autopurge_nowriter_samples_delay.nanosec = DDS::DURATION_INFINITE_NSEC;
1030 80 : qos_.autopurge_disposed_samples_delay.sec = DDS::DURATION_INFINITE_SEC;
1031 80 : qos_.autopurge_disposed_samples_delay.nanosec = DDS::DURATION_INFINITE_NSEC;
1032 80 : }
1033 :
1034 : const DDS::ReaderDataLifecycleQosPolicy& qos() const { return qos_; }
1035 4 : DDS::ReaderDataLifecycleQosPolicy& qos() { return qos_; }
1036 1 : operator const DDS::ReaderDataLifecycleQosPolicy&() const { return qos_; }
1037 78 : operator DDS::ReaderDataLifecycleQosPolicy&() { return qos_; }
1038 :
1039 1 : ReaderDataLifecycleQosPolicyBuilder& autopurge_nowriter_samples_delay(const DDS::Duration_t& duration)
1040 : {
1041 1 : qos_.autopurge_nowriter_samples_delay = duration;
1042 1 : return *this;
1043 : }
1044 :
1045 : ReaderDataLifecycleQosPolicyBuilder& autopurge_disposed_samples_delay(const DDS::Duration_t& duration)
1046 : {
1047 : qos_.autopurge_disposed_samples_delay = duration;
1048 : return *this;
1049 : }
1050 :
1051 : private:
1052 : DDS::ReaderDataLifecycleQosPolicy qos_;
1053 : };
1054 :
1055 : class TypeConsistencyEnforcementQosPolicyBuilder {
1056 : public:
1057 87 : TypeConsistencyEnforcementQosPolicyBuilder()
1058 87 : {
1059 87 : qos_.kind = DDS::ALLOW_TYPE_COERCION;
1060 87 : qos_.ignore_sequence_bounds = true;
1061 87 : qos_.ignore_string_bounds = true;
1062 87 : qos_.ignore_member_names = false;
1063 87 : qos_.prevent_type_widening = false;
1064 87 : qos_.force_type_validation = false;
1065 87 : }
1066 :
1067 : const DDS::TypeConsistencyEnforcementQosPolicy& qos() const { return qos_; }
1068 11 : DDS::TypeConsistencyEnforcementQosPolicy& qos() { return qos_; }
1069 1 : operator const DDS::TypeConsistencyEnforcementQosPolicy&() const { return qos_; }
1070 78 : operator DDS::TypeConsistencyEnforcementQosPolicy&() { return qos_; }
1071 :
1072 1 : TypeConsistencyEnforcementQosPolicyBuilder& kind(DDS::TypeConsistencyEnforcementQosPolicyKind_t kind)
1073 : {
1074 1 : qos_.kind = kind;
1075 1 : return *this;
1076 : }
1077 :
1078 1 : TypeConsistencyEnforcementQosPolicyBuilder& disallow_type_coercion()
1079 : {
1080 1 : qos_.kind = DDS::DISALLOW_TYPE_COERCION;
1081 1 : return *this;
1082 : }
1083 :
1084 1 : TypeConsistencyEnforcementQosPolicyBuilder& allow_type_coercion()
1085 : {
1086 1 : qos_.kind = DDS::ALLOW_TYPE_COERCION;
1087 1 : return *this;
1088 : }
1089 :
1090 1 : TypeConsistencyEnforcementQosPolicyBuilder& ignore_sequence_bounds(bool value)
1091 : {
1092 1 : qos_.ignore_sequence_bounds = value;
1093 1 : return *this;
1094 : }
1095 :
1096 1 : TypeConsistencyEnforcementQosPolicyBuilder& ignore_string_bounds(bool value)
1097 : {
1098 1 : qos_.ignore_string_bounds = value;
1099 1 : return *this;
1100 : }
1101 :
1102 1 : TypeConsistencyEnforcementQosPolicyBuilder& ignore_member_names(bool value)
1103 : {
1104 1 : qos_.ignore_member_names = value;
1105 1 : return *this;
1106 : }
1107 :
1108 1 : TypeConsistencyEnforcementQosPolicyBuilder& prevent_type_widening(bool value)
1109 : {
1110 1 : qos_.prevent_type_widening = value;
1111 1 : return *this;
1112 : }
1113 :
1114 1 : TypeConsistencyEnforcementQosPolicyBuilder& force_type_validation(bool value)
1115 : {
1116 1 : qos_.force_type_validation = value;
1117 1 : return *this;
1118 : }
1119 :
1120 : private:
1121 : DDS::TypeConsistencyEnforcementQosPolicy qos_;
1122 : };
1123 :
1124 : class TopicQosBuilder {
1125 : public:
1126 45 : TopicQosBuilder()
1127 45 : {
1128 : // topic_data
1129 45 : qos_.durability = DurabilityQosPolicyBuilder();
1130 45 : qos_.durability_service = DurabilityServiceQosPolicyBuilder();
1131 45 : qos_.deadline = DeadlineQosPolicyBuilder();
1132 45 : qos_.latency_budget = LatencyBudgetQosPolicyBuilder();
1133 45 : qos_.liveliness = LivelinessQosPolicyBuilder();
1134 45 : qos_.reliability = ReliabilityQosPolicyBuilder();
1135 45 : qos_.destination_order = DestinationOrderQosPolicyBuilder();
1136 45 : qos_.history = HistoryQosPolicyBuilder();
1137 45 : qos_.resource_limits = ResourceLimitsQosPolicyBuilder();
1138 45 : qos_.transport_priority = TransportPriorityQosPolicyBuilder();
1139 45 : qos_.lifespan = LifespanQosPolicyBuilder();
1140 45 : qos_.ownership = OwnershipQosPolicyBuilder();
1141 : // representation
1142 45 : }
1143 :
1144 : const DDS::TopicQos& qos() const { return qos_; }
1145 68 : DDS::TopicQos& qos() { return qos_; }
1146 1 : operator const DDS::TopicQos&() const { return qos_; }
1147 2 : operator DDS::TopicQos&() { return qos_; }
1148 :
1149 1 : TopicQosBuilder& topic_data_value(const DDS::OctetSeq& value)
1150 : {
1151 1 : qos_.topic_data.value = value;
1152 1 : return *this;
1153 : }
1154 :
1155 1 : TopicQosBuilder& durability_kind(DDS::DurabilityQosPolicyKind kind)
1156 : {
1157 1 : qos_.durability.kind = kind;
1158 1 : return *this;
1159 : }
1160 :
1161 1 : TopicQosBuilder& durability_volatile()
1162 : {
1163 1 : qos_.durability.kind = DDS::VOLATILE_DURABILITY_QOS;
1164 1 : return *this;
1165 : }
1166 :
1167 4 : TopicQosBuilder& durability_transient_local()
1168 : {
1169 4 : qos_.durability.kind = DDS::TRANSIENT_LOCAL_DURABILITY_QOS;
1170 4 : return *this;
1171 : }
1172 :
1173 1 : TopicQosBuilder& durability_transient()
1174 : {
1175 1 : qos_.durability.kind = DDS::TRANSIENT_DURABILITY_QOS;
1176 1 : return *this;
1177 : }
1178 :
1179 1 : TopicQosBuilder& durability_persistent()
1180 : {
1181 1 : qos_.durability.kind = DDS::PERSISTENT_DURABILITY_QOS;
1182 1 : return *this;
1183 : }
1184 :
1185 1 : TopicQosBuilder& durability_service_service_cleanup_delay(const DDS::Duration_t& delay)
1186 : {
1187 1 : qos_.durability_service.service_cleanup_delay = delay;
1188 1 : return *this;
1189 : }
1190 :
1191 1 : TopicQosBuilder& durability_service_history_kind(DDS::HistoryQosPolicyKind kind)
1192 : {
1193 1 : qos_.durability_service.history_kind = kind;
1194 1 : return *this;
1195 : }
1196 :
1197 1 : TopicQosBuilder& durability_service_keep_last(int depth)
1198 : {
1199 1 : qos_.durability_service.history_kind = DDS::KEEP_LAST_HISTORY_QOS;
1200 1 : qos_.durability_service.history_depth = depth;
1201 1 : return *this;
1202 : }
1203 :
1204 1 : TopicQosBuilder& durability_service_keep_all()
1205 : {
1206 1 : qos_.durability_service.history_kind = DDS::KEEP_ALL_HISTORY_QOS;
1207 1 : return *this;
1208 : }
1209 :
1210 1 : TopicQosBuilder& durability_service_history_depth(int depth)
1211 : {
1212 1 : qos_.durability_service.history_depth = depth;
1213 1 : return *this;
1214 : }
1215 :
1216 1 : TopicQosBuilder& durability_service_max_samples(int value)
1217 : {
1218 1 : qos_.durability_service.max_samples = value;
1219 1 : return *this;
1220 : }
1221 :
1222 1 : TopicQosBuilder& durability_service_max_instances(int value)
1223 : {
1224 1 : qos_.durability_service.max_instances = value;
1225 1 : return *this;
1226 : }
1227 :
1228 1 : TopicQosBuilder& durability_service_max_samples_per_instance(int value)
1229 : {
1230 1 : qos_.durability_service.max_samples_per_instance = value;
1231 1 : return *this;
1232 : }
1233 :
1234 1 : TopicQosBuilder& deadline_period(const DDS::Duration_t& duration)
1235 : {
1236 1 : qos_.deadline.period = duration;
1237 1 : return *this;
1238 : }
1239 :
1240 1 : TopicQosBuilder& latency_budget_duration(const DDS::Duration_t& duration)
1241 : {
1242 1 : qos_.latency_budget.duration = duration;
1243 1 : return *this;
1244 : }
1245 :
1246 1 : TopicQosBuilder& liveliness_kind(DDS::LivelinessQosPolicyKind kind)
1247 : {
1248 1 : qos_.liveliness.kind = kind;
1249 1 : return *this;
1250 : }
1251 :
1252 1 : TopicQosBuilder& liveliness_automatic()
1253 : {
1254 1 : qos_.liveliness.kind = DDS::AUTOMATIC_LIVELINESS_QOS;
1255 1 : return *this;
1256 : }
1257 :
1258 3 : TopicQosBuilder& liveliness_manual_by_participant()
1259 : {
1260 3 : qos_.liveliness.kind = DDS::MANUAL_BY_PARTICIPANT_LIVELINESS_QOS;
1261 3 : return *this;
1262 : }
1263 :
1264 2 : TopicQosBuilder& liveliness_manual_by_topic()
1265 : {
1266 2 : qos_.liveliness.kind = DDS::MANUAL_BY_TOPIC_LIVELINESS_QOS;
1267 2 : return *this;
1268 : }
1269 :
1270 1 : TopicQosBuilder& liveliness_lease_duration(const DDS::Duration_t& duration)
1271 : {
1272 1 : qos_.liveliness.lease_duration = duration;
1273 1 : return *this;
1274 : }
1275 :
1276 1 : TopicQosBuilder& reliability_kind(DDS::ReliabilityQosPolicyKind kind)
1277 : {
1278 1 : qos_.reliability.kind = kind;
1279 1 : return *this;
1280 : }
1281 :
1282 2 : TopicQosBuilder& reliability_best_effort()
1283 : {
1284 2 : qos_.reliability.kind = DDS::BEST_EFFORT_RELIABILITY_QOS;
1285 2 : return *this;
1286 : }
1287 :
1288 1 : TopicQosBuilder& reliability_reliable()
1289 : {
1290 1 : qos_.reliability.kind = DDS::RELIABLE_RELIABILITY_QOS;
1291 1 : return *this;
1292 : }
1293 :
1294 1 : TopicQosBuilder& reliability_max_blocking_time(const DDS::Duration_t& duration)
1295 : {
1296 1 : qos_.reliability.max_blocking_time = duration;
1297 1 : return *this;
1298 : }
1299 :
1300 1 : TopicQosBuilder& destination_order_kind(DDS::DestinationOrderQosPolicyKind kind)
1301 : {
1302 1 : qos_.destination_order.kind = kind;
1303 1 : return *this;
1304 : }
1305 :
1306 1 : TopicQosBuilder& destination_order_by_reception_timestamp()
1307 : {
1308 1 : qos_.destination_order.kind = DDS::BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS;
1309 1 : return *this;
1310 : }
1311 :
1312 2 : TopicQosBuilder& destination_order_by_source_timestamp()
1313 : {
1314 2 : qos_.destination_order.kind = DDS::BY_SOURCE_TIMESTAMP_DESTINATIONORDER_QOS;
1315 2 : return *this;
1316 : }
1317 :
1318 1 : TopicQosBuilder& history_kind(DDS::HistoryQosPolicyKind kind)
1319 : {
1320 1 : qos_.history.kind = kind;
1321 1 : return *this;
1322 : }
1323 :
1324 1 : TopicQosBuilder& history_keep_last(int depth)
1325 : {
1326 1 : qos_.history.kind = DDS::KEEP_LAST_HISTORY_QOS;
1327 1 : qos_.history.depth = depth;
1328 1 : return *this;
1329 : }
1330 :
1331 1 : TopicQosBuilder& history_keep_all()
1332 : {
1333 1 : qos_.history.kind = DDS::KEEP_ALL_HISTORY_QOS;
1334 1 : return *this;
1335 : }
1336 :
1337 1 : TopicQosBuilder& history_depth(int depth)
1338 : {
1339 1 : qos_.history.depth = depth;
1340 1 : return *this;
1341 : }
1342 :
1343 1 : TopicQosBuilder& resource_limits_max_samples(int value)
1344 : {
1345 1 : qos_.resource_limits.max_samples = value;
1346 1 : return *this;
1347 : }
1348 :
1349 1 : TopicQosBuilder& resource_limits_max_instances(int value)
1350 : {
1351 1 : qos_.resource_limits.max_instances = value;
1352 1 : return *this;
1353 : }
1354 :
1355 1 : TopicQosBuilder& resource_limits_max_samples_per_instance(int value)
1356 : {
1357 1 : qos_.resource_limits.max_samples_per_instance = value;
1358 1 : return *this;
1359 : }
1360 :
1361 1 : TopicQosBuilder& transport_priority_value(int value)
1362 : {
1363 1 : qos_.transport_priority.value = value;
1364 1 : return *this;
1365 : }
1366 :
1367 1 : TopicQosBuilder& lifespan_duration(const DDS::Duration_t& duration)
1368 : {
1369 1 : qos_.lifespan.duration = duration;
1370 1 : return *this;
1371 : }
1372 :
1373 1 : TopicQosBuilder& ownership_kind(DDS::OwnershipQosPolicyKind kind)
1374 : {
1375 1 : qos_.ownership.kind = kind;
1376 1 : return *this;
1377 : }
1378 :
1379 1 : TopicQosBuilder& ownership_shared()
1380 : {
1381 1 : qos_.ownership.kind = DDS::SHARED_OWNERSHIP_QOS;
1382 1 : return *this;
1383 : }
1384 :
1385 1 : TopicQosBuilder& ownership_exclusive()
1386 : {
1387 1 : qos_.ownership.kind = DDS::EXCLUSIVE_OWNERSHIP_QOS;
1388 1 : return *this;
1389 : }
1390 :
1391 : private:
1392 : DDS::TopicQos qos_;
1393 : };
1394 :
1395 : class OpenDDS_Dcps_Export DataWriterQosBuilder {
1396 : public:
1397 71 : DataWriterQosBuilder()
1398 71 : {
1399 71 : qos_.durability = DurabilityQosPolicyBuilder();
1400 71 : qos_.durability_service = DurabilityServiceQosPolicyBuilder();
1401 71 : qos_.deadline = DeadlineQosPolicyBuilder();
1402 71 : qos_.latency_budget = LatencyBudgetQosPolicyBuilder();
1403 71 : qos_.liveliness = LivelinessQosPolicyBuilder();
1404 71 : qos_.reliability = ReliabilityQosPolicyBuilder().reliable().max_blocking_time(make_duration_t(0, 100000000));
1405 71 : qos_.destination_order = DestinationOrderQosPolicyBuilder();
1406 71 : qos_.history = HistoryQosPolicyBuilder();
1407 71 : qos_.resource_limits = ResourceLimitsQosPolicyBuilder();
1408 71 : qos_.transport_priority = TransportPriorityQosPolicyBuilder();
1409 71 : qos_.lifespan = LifespanQosPolicyBuilder();
1410 : // userdata
1411 71 : qos_.ownership = OwnershipQosPolicyBuilder();
1412 71 : qos_.ownership_strength = OwnershipStrengthQosPolicyBuilder();
1413 71 : qos_.writer_data_lifecycle = WriterDataLifecycleQosPolicyBuilder();
1414 : // representation
1415 71 : }
1416 :
1417 : explicit DataWriterQosBuilder(DDS::Publisher_var publisher);
1418 :
1419 : DataWriterQosBuilder(DDS::Topic_var topic,
1420 : DDS::Publisher_var publisher);
1421 :
1422 : const DDS::DataWriterQos& qos() const { return qos_; }
1423 73 : DDS::DataWriterQos& qos() { return qos_; }
1424 24 : operator const DDS::DataWriterQos&() const { return qos_; }
1425 2 : operator DDS::DataWriterQos&() { return qos_; }
1426 :
1427 3 : bool operator==(const DataWriterQosBuilder& other) const
1428 : {
1429 3 : return qos_ == other.qos_;
1430 : }
1431 :
1432 1 : bool operator!=(const DataWriterQosBuilder& other) const
1433 : {
1434 1 : return !(*this == other);
1435 : }
1436 :
1437 1 : DataWriterQosBuilder& durability_kind(DDS::DurabilityQosPolicyKind kind)
1438 : {
1439 1 : qos_.durability.kind = kind;
1440 1 : return *this;
1441 : }
1442 :
1443 1 : DataWriterQosBuilder& durability_volatile()
1444 : {
1445 1 : qos_.durability.kind = DDS::VOLATILE_DURABILITY_QOS;
1446 1 : return *this;
1447 : }
1448 :
1449 14 : DataWriterQosBuilder& durability_transient_local()
1450 : {
1451 14 : qos_.durability.kind = DDS::TRANSIENT_LOCAL_DURABILITY_QOS;
1452 14 : return *this;
1453 : }
1454 :
1455 1 : DataWriterQosBuilder& durability_transient()
1456 : {
1457 1 : qos_.durability.kind = DDS::TRANSIENT_DURABILITY_QOS;
1458 1 : return *this;
1459 : }
1460 :
1461 1 : DataWriterQosBuilder& durability_persistent()
1462 : {
1463 1 : qos_.durability.kind = DDS::PERSISTENT_DURABILITY_QOS;
1464 1 : return *this;
1465 : }
1466 :
1467 1 : DataWriterQosBuilder& durability_service_service_cleanup_delay(const DDS::Duration_t& delay)
1468 : {
1469 1 : qos_.durability_service.service_cleanup_delay = delay;
1470 1 : return *this;
1471 : }
1472 :
1473 1 : DataWriterQosBuilder& durability_service_history_kind(DDS::HistoryQosPolicyKind kind)
1474 : {
1475 1 : qos_.durability_service.history_kind = kind;
1476 1 : return *this;
1477 : }
1478 :
1479 1 : DataWriterQosBuilder& durability_service_keep_last(int depth)
1480 : {
1481 1 : qos_.durability_service.history_kind = DDS::KEEP_LAST_HISTORY_QOS;
1482 1 : qos_.durability_service.history_depth = depth;
1483 1 : return *this;
1484 : }
1485 :
1486 1 : DataWriterQosBuilder& durability_service_keep_all()
1487 : {
1488 1 : qos_.durability_service.history_kind = DDS::KEEP_ALL_HISTORY_QOS;
1489 1 : return *this;
1490 : }
1491 :
1492 1 : DataWriterQosBuilder& durability_service_history_depth(int depth)
1493 : {
1494 1 : qos_.durability_service.history_depth = depth;
1495 1 : return *this;
1496 : }
1497 :
1498 1 : DataWriterQosBuilder& durability_service_max_samples(int value)
1499 : {
1500 1 : qos_.durability_service.max_samples = value;
1501 1 : return *this;
1502 : }
1503 :
1504 1 : DataWriterQosBuilder& durability_service_max_instances(int value)
1505 : {
1506 1 : qos_.durability_service.max_instances = value;
1507 1 : return *this;
1508 : }
1509 :
1510 1 : DataWriterQosBuilder& durability_service_max_samples_per_instance(int value)
1511 : {
1512 1 : qos_.durability_service.max_samples_per_instance = value;
1513 1 : return *this;
1514 : }
1515 :
1516 1 : DataWriterQosBuilder& deadline_period(const DDS::Duration_t& duration)
1517 : {
1518 1 : qos_.deadline.period = duration;
1519 1 : return *this;
1520 : }
1521 :
1522 1 : DataWriterQosBuilder& latency_budget_duration(const DDS::Duration_t& duration)
1523 : {
1524 1 : qos_.latency_budget.duration = duration;
1525 1 : return *this;
1526 : }
1527 :
1528 1 : DataWriterQosBuilder& liveliness_kind(DDS::LivelinessQosPolicyKind kind)
1529 : {
1530 1 : qos_.liveliness.kind = kind;
1531 1 : return *this;
1532 : }
1533 :
1534 1 : DataWriterQosBuilder& liveliness_automatic()
1535 : {
1536 1 : qos_.liveliness.kind = DDS::AUTOMATIC_LIVELINESS_QOS;
1537 1 : return *this;
1538 : }
1539 :
1540 3 : DataWriterQosBuilder& liveliness_manual_by_participant()
1541 : {
1542 3 : qos_.liveliness.kind = DDS::MANUAL_BY_PARTICIPANT_LIVELINESS_QOS;
1543 3 : return *this;
1544 : }
1545 :
1546 2 : DataWriterQosBuilder& liveliness_manual_by_topic()
1547 : {
1548 2 : qos_.liveliness.kind = DDS::MANUAL_BY_TOPIC_LIVELINESS_QOS;
1549 2 : return *this;
1550 : }
1551 :
1552 1 : DataWriterQosBuilder& liveliness_lease_duration(const DDS::Duration_t& duration)
1553 : {
1554 1 : qos_.liveliness.lease_duration = duration;
1555 1 : return *this;
1556 : }
1557 :
1558 1 : DataWriterQosBuilder& reliability_kind(DDS::ReliabilityQosPolicyKind kind)
1559 : {
1560 1 : qos_.reliability.kind = kind;
1561 1 : return *this;
1562 : }
1563 :
1564 4 : DataWriterQosBuilder& reliability_best_effort()
1565 : {
1566 4 : qos_.reliability.kind = DDS::BEST_EFFORT_RELIABILITY_QOS;
1567 4 : return *this;
1568 : }
1569 :
1570 1 : DataWriterQosBuilder& reliability_reliable()
1571 : {
1572 1 : qos_.reliability.kind = DDS::RELIABLE_RELIABILITY_QOS;
1573 1 : return *this;
1574 : }
1575 :
1576 1 : DataWriterQosBuilder& reliability_max_blocking_time(const DDS::Duration_t& duration)
1577 : {
1578 1 : qos_.reliability.max_blocking_time = duration;
1579 1 : return *this;
1580 : }
1581 :
1582 1 : DataWriterQosBuilder& destination_order_kind(DDS::DestinationOrderQosPolicyKind kind)
1583 : {
1584 1 : qos_.destination_order.kind = kind;
1585 1 : return *this;
1586 : }
1587 :
1588 1 : DataWriterQosBuilder& destination_order_by_reception_timestamp()
1589 : {
1590 1 : qos_.destination_order.kind = DDS::BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS;
1591 1 : return *this;
1592 : }
1593 :
1594 2 : DataWriterQosBuilder& destination_order_by_source_timestamp()
1595 : {
1596 2 : qos_.destination_order.kind = DDS::BY_SOURCE_TIMESTAMP_DESTINATIONORDER_QOS;
1597 2 : return *this;
1598 : }
1599 :
1600 1 : DataWriterQosBuilder& history_kind(DDS::HistoryQosPolicyKind kind)
1601 : {
1602 1 : qos_.history.kind = kind;
1603 1 : return *this;
1604 : }
1605 :
1606 1 : DataWriterQosBuilder& history_keep_last(int depth)
1607 : {
1608 1 : qos_.history.kind = DDS::KEEP_LAST_HISTORY_QOS;
1609 1 : qos_.history.depth = depth;
1610 1 : return *this;
1611 : }
1612 :
1613 1 : DataWriterQosBuilder& history_keep_all()
1614 : {
1615 1 : qos_.history.kind = DDS::KEEP_ALL_HISTORY_QOS;
1616 1 : return *this;
1617 : }
1618 :
1619 2 : DataWriterQosBuilder& history_depth(int depth)
1620 : {
1621 2 : qos_.history.depth = depth;
1622 2 : return *this;
1623 : }
1624 :
1625 1 : DataWriterQosBuilder& resource_limits_max_samples(int value)
1626 : {
1627 1 : qos_.resource_limits.max_samples = value;
1628 1 : return *this;
1629 : }
1630 :
1631 1 : DataWriterQosBuilder& resource_limits_max_instances(int value)
1632 : {
1633 1 : qos_.resource_limits.max_instances = value;
1634 1 : return *this;
1635 : }
1636 :
1637 1 : DataWriterQosBuilder& resource_limits_max_samples_per_instance(int value)
1638 : {
1639 1 : qos_.resource_limits.max_samples_per_instance = value;
1640 1 : return *this;
1641 : }
1642 :
1643 1 : DataWriterQosBuilder& transport_priority_value(int value)
1644 : {
1645 1 : qos_.transport_priority.value = value;
1646 1 : return *this;
1647 : }
1648 :
1649 1 : DataWriterQosBuilder& lifespan_duration(const DDS::Duration_t& duration)
1650 : {
1651 1 : qos_.lifespan.duration = duration;
1652 1 : return *this;
1653 : }
1654 :
1655 1 : DataWriterQosBuilder& user_data_value(const DDS::OctetSeq& value)
1656 : {
1657 1 : qos_.user_data.value = value;
1658 1 : return *this;
1659 : }
1660 :
1661 1 : DataWriterQosBuilder& ownership_kind(DDS::OwnershipQosPolicyKind kind)
1662 : {
1663 1 : qos_.ownership.kind = kind;
1664 1 : return *this;
1665 : }
1666 :
1667 1 : DataWriterQosBuilder& ownership_shared()
1668 : {
1669 1 : qos_.ownership.kind = DDS::SHARED_OWNERSHIP_QOS;
1670 1 : return *this;
1671 : }
1672 :
1673 1 : DataWriterQosBuilder& ownership_exclusive()
1674 : {
1675 1 : qos_.ownership.kind = DDS::EXCLUSIVE_OWNERSHIP_QOS;
1676 1 : return *this;
1677 : }
1678 :
1679 1 : DataWriterQosBuilder& ownership_strength_value(int value)
1680 : {
1681 1 : qos_.ownership_strength.value = value;
1682 1 : return *this;
1683 : }
1684 :
1685 3 : DataWriterQosBuilder& writer_data_lifecycle_autodispose_unregistered_instances(bool value)
1686 : {
1687 3 : qos_.writer_data_lifecycle.autodispose_unregistered_instances = value;
1688 3 : return *this;
1689 : }
1690 :
1691 : private:
1692 : DDS::DataWriterQos qos_;
1693 : };
1694 :
1695 : class OpenDDS_Dcps_Export DataReaderQosBuilder {
1696 : public:
1697 76 : DataReaderQosBuilder()
1698 76 : {
1699 76 : qos_.durability = DurabilityQosPolicyBuilder();
1700 76 : qos_.deadline = DeadlineQosPolicyBuilder();
1701 76 : qos_.latency_budget = LatencyBudgetQosPolicyBuilder();
1702 76 : qos_.liveliness = LivelinessQosPolicyBuilder();
1703 76 : qos_.reliability = ReliabilityQosPolicyBuilder();
1704 76 : qos_.destination_order = DestinationOrderQosPolicyBuilder();
1705 76 : qos_.history = HistoryQosPolicyBuilder();
1706 76 : qos_.resource_limits = ResourceLimitsQosPolicyBuilder();
1707 : // userdata
1708 76 : qos_.ownership = OwnershipQosPolicyBuilder();
1709 76 : qos_.time_based_filter = TimeBasedFilterQosPolicyBuilder();
1710 76 : qos_.reader_data_lifecycle = ReaderDataLifecycleQosPolicyBuilder();
1711 : // representation
1712 76 : qos_.type_consistency = TypeConsistencyEnforcementQosPolicyBuilder();
1713 76 : }
1714 :
1715 : explicit DataReaderQosBuilder(DDS::Subscriber_var subscriber);
1716 :
1717 : DataReaderQosBuilder(DDS::Topic_var topic,
1718 : DDS::Subscriber_var subscriber);
1719 :
1720 : const DDS::DataReaderQos& qos() const { return qos_; }
1721 61 : DDS::DataReaderQos& qos() { return qos_; }
1722 30 : operator const DDS::DataReaderQos&() const { return qos_; }
1723 2 : operator DDS::DataReaderQos&() { return qos_; }
1724 :
1725 3 : bool operator==(const DataReaderQosBuilder& other) const
1726 : {
1727 3 : return qos_ == other.qos_;
1728 : }
1729 :
1730 1 : bool operator!=(const DataReaderQosBuilder& other) const
1731 : {
1732 1 : return !(*this == other);
1733 : }
1734 :
1735 1 : DataReaderQosBuilder& durability_kind(DDS::DurabilityQosPolicyKind kind)
1736 : {
1737 1 : qos_.durability.kind = kind;
1738 1 : return *this;
1739 : }
1740 :
1741 1 : DataReaderQosBuilder& durability_volatile()
1742 : {
1743 1 : qos_.durability.kind = DDS::VOLATILE_DURABILITY_QOS;
1744 1 : return *this;
1745 : }
1746 :
1747 6 : DataReaderQosBuilder& durability_transient_local()
1748 : {
1749 6 : qos_.durability.kind = DDS::TRANSIENT_LOCAL_DURABILITY_QOS;
1750 6 : return *this;
1751 : }
1752 :
1753 1 : DataReaderQosBuilder& durability_transient()
1754 : {
1755 1 : qos_.durability.kind = DDS::TRANSIENT_DURABILITY_QOS;
1756 1 : return *this;
1757 : }
1758 :
1759 1 : DataReaderQosBuilder& durability_persistent()
1760 : {
1761 1 : qos_.durability.kind = DDS::PERSISTENT_DURABILITY_QOS;
1762 1 : return *this;
1763 : }
1764 :
1765 1 : DataReaderQosBuilder& deadline_period(const DDS::Duration_t& duration)
1766 : {
1767 1 : qos_.deadline.period = duration;
1768 1 : return *this;
1769 : }
1770 :
1771 1 : DataReaderQosBuilder& latency_budget_duration(const DDS::Duration_t& duration)
1772 : {
1773 1 : qos_.latency_budget.duration = duration;
1774 1 : return *this;
1775 : }
1776 :
1777 1 : DataReaderQosBuilder& liveliness_kind(DDS::LivelinessQosPolicyKind kind)
1778 : {
1779 1 : qos_.liveliness.kind = kind;
1780 1 : return *this;
1781 : }
1782 :
1783 1 : DataReaderQosBuilder& liveliness_automatic()
1784 : {
1785 1 : qos_.liveliness.kind = DDS::AUTOMATIC_LIVELINESS_QOS;
1786 1 : return *this;
1787 : }
1788 :
1789 3 : DataReaderQosBuilder& liveliness_manual_by_participant()
1790 : {
1791 3 : qos_.liveliness.kind = DDS::MANUAL_BY_PARTICIPANT_LIVELINESS_QOS;
1792 3 : return *this;
1793 : }
1794 :
1795 2 : DataReaderQosBuilder& liveliness_manual_by_topic()
1796 : {
1797 2 : qos_.liveliness.kind = DDS::MANUAL_BY_TOPIC_LIVELINESS_QOS;
1798 2 : return *this;
1799 : }
1800 :
1801 1 : DataReaderQosBuilder& liveliness_lease_duration(const DDS::Duration_t& duration)
1802 : {
1803 1 : qos_.liveliness.lease_duration = duration;
1804 1 : return *this;
1805 : }
1806 :
1807 1 : DataReaderQosBuilder& reliability_kind(DDS::ReliabilityQosPolicyKind kind)
1808 : {
1809 1 : qos_.reliability.kind = kind;
1810 1 : return *this;
1811 : }
1812 :
1813 4 : DataReaderQosBuilder& reliability_best_effort()
1814 : {
1815 4 : qos_.reliability.kind = DDS::BEST_EFFORT_RELIABILITY_QOS;
1816 4 : return *this;
1817 : }
1818 :
1819 30 : DataReaderQosBuilder& reliability_reliable()
1820 : {
1821 30 : qos_.reliability.kind = DDS::RELIABLE_RELIABILITY_QOS;
1822 30 : return *this;
1823 : }
1824 :
1825 1 : DataReaderQosBuilder& reliability_max_blocking_time(const DDS::Duration_t& duration)
1826 : {
1827 1 : qos_.reliability.max_blocking_time = duration;
1828 1 : return *this;
1829 : }
1830 :
1831 1 : DataReaderQosBuilder& destination_order_kind(DDS::DestinationOrderQosPolicyKind kind)
1832 : {
1833 1 : qos_.destination_order.kind = kind;
1834 1 : return *this;
1835 : }
1836 :
1837 1 : DataReaderQosBuilder& destination_order_by_reception_timestamp()
1838 : {
1839 1 : qos_.destination_order.kind = DDS::BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS;
1840 1 : return *this;
1841 : }
1842 :
1843 2 : DataReaderQosBuilder& destination_order_by_source_timestamp()
1844 : {
1845 2 : qos_.destination_order.kind = DDS::BY_SOURCE_TIMESTAMP_DESTINATIONORDER_QOS;
1846 2 : return *this;
1847 : }
1848 :
1849 1 : DataReaderQosBuilder& history_kind(DDS::HistoryQosPolicyKind kind)
1850 : {
1851 1 : qos_.history.kind = kind;
1852 1 : return *this;
1853 : }
1854 :
1855 1 : DataReaderQosBuilder& history_keep_last(int depth)
1856 : {
1857 1 : qos_.history.kind = DDS::KEEP_LAST_HISTORY_QOS;
1858 1 : qos_.history.depth = depth;
1859 1 : return *this;
1860 : }
1861 :
1862 3 : DataReaderQosBuilder& history_keep_all()
1863 : {
1864 3 : qos_.history.kind = DDS::KEEP_ALL_HISTORY_QOS;
1865 3 : return *this;
1866 : }
1867 :
1868 1 : DataReaderQosBuilder& history_depth(int depth)
1869 : {
1870 1 : qos_.history.depth = depth;
1871 1 : return *this;
1872 : }
1873 :
1874 1 : DataReaderQosBuilder& resource_limits_max_samples(int value)
1875 : {
1876 1 : qos_.resource_limits.max_samples = value;
1877 1 : return *this;
1878 : }
1879 :
1880 1 : DataReaderQosBuilder& resource_limits_max_instances(int value)
1881 : {
1882 1 : qos_.resource_limits.max_instances = value;
1883 1 : return *this;
1884 : }
1885 :
1886 1 : DataReaderQosBuilder& resource_limits_max_samples_per_instance(int value)
1887 : {
1888 1 : qos_.resource_limits.max_samples_per_instance = value;
1889 1 : return *this;
1890 : }
1891 :
1892 1 : DataReaderQosBuilder& user_data_value(const DDS::OctetSeq& value)
1893 : {
1894 1 : qos_.user_data.value = value;
1895 1 : return *this;
1896 : }
1897 :
1898 1 : DataReaderQosBuilder& ownership_kind(DDS::OwnershipQosPolicyKind kind)
1899 : {
1900 1 : qos_.ownership.kind = kind;
1901 1 : return *this;
1902 : }
1903 :
1904 1 : DataReaderQosBuilder& ownership_shared()
1905 : {
1906 1 : qos_.ownership.kind = DDS::SHARED_OWNERSHIP_QOS;
1907 1 : return *this;
1908 : }
1909 :
1910 1 : DataReaderQosBuilder& ownership_exclusive()
1911 : {
1912 1 : qos_.ownership.kind = DDS::EXCLUSIVE_OWNERSHIP_QOS;
1913 1 : return *this;
1914 : }
1915 :
1916 1 : DataReaderQosBuilder& time_based_filter_minimum_separation(const DDS::Duration_t& duration)
1917 : {
1918 1 : qos_.time_based_filter.minimum_separation = duration;
1919 1 : return *this;
1920 : }
1921 :
1922 2 : DataReaderQosBuilder& reader_data_lifecycle_autopurge_nowriter_samples_delay(const DDS::Duration_t& duration)
1923 : {
1924 2 : qos_.reader_data_lifecycle.autopurge_nowriter_samples_delay = duration;
1925 2 : return *this;
1926 : }
1927 :
1928 1 : DataReaderQosBuilder& reader_data_lifecycle_autopurge_disposed_samples_delay(const DDS::Duration_t& duration)
1929 : {
1930 1 : qos_.reader_data_lifecycle.autopurge_disposed_samples_delay = duration;
1931 1 : return *this;
1932 : }
1933 :
1934 1 : DataReaderQosBuilder& type_consistency_kind(DDS::TypeConsistencyEnforcementQosPolicyKind_t kind)
1935 : {
1936 1 : qos_.type_consistency.kind = kind;
1937 1 : return *this;
1938 : }
1939 :
1940 1 : DataReaderQosBuilder& type_consistency_disallow_type_coercion()
1941 : {
1942 1 : qos_.type_consistency.kind = DDS::DISALLOW_TYPE_COERCION;
1943 1 : return *this;
1944 : }
1945 :
1946 1 : DataReaderQosBuilder& type_consistency_allow_type_coercion()
1947 : {
1948 1 : qos_.type_consistency.kind = DDS::ALLOW_TYPE_COERCION;
1949 1 : return *this;
1950 : }
1951 :
1952 1 : DataReaderQosBuilder& type_consistency_ignore_sequence_bounds(bool value)
1953 : {
1954 1 : qos_.type_consistency.ignore_sequence_bounds = value;
1955 1 : return *this;
1956 : }
1957 :
1958 1 : DataReaderQosBuilder& type_consistency_ignore_string_bounds(bool value)
1959 : {
1960 1 : qos_.type_consistency.ignore_string_bounds = value;
1961 1 : return *this;
1962 : }
1963 :
1964 1 : DataReaderQosBuilder& type_consistency_ignore_member_names(bool value)
1965 : {
1966 1 : qos_.type_consistency.ignore_member_names = value;
1967 1 : return *this;
1968 : }
1969 :
1970 1 : DataReaderQosBuilder& type_consistency_prevent_type_widening(bool value)
1971 : {
1972 1 : qos_.type_consistency.prevent_type_widening = value;
1973 1 : return *this;
1974 : }
1975 :
1976 1 : DataReaderQosBuilder& type_consistency_force_type_validation(bool value)
1977 : {
1978 1 : qos_.type_consistency.force_type_validation = value;
1979 1 : return *this;
1980 : }
1981 :
1982 : private:
1983 : DDS::DataReaderQos qos_;
1984 : };
1985 :
1986 : } // namespace DCPS
1987 : } // namespace OpenDDS
1988 :
1989 : OPENDDS_END_VERSIONED_NAMESPACE_DECL
1990 :
1991 : #if defined(__ACE_INLINE__)
1992 : #include "Qos_Helper.inl"
1993 : #endif /* __ACE_INLINE__ */
1994 :
1995 : #endif /* OPENDDS_DCPS_QOS_HELPER_H */
|