Line data Source code
1 : /*
2 : *
3 : *
4 : * Distributed under the OpenDDS License.
5 : * See: http://www.opendds.org/license.html
6 : */
7 :
8 : #include "ace/OS_NS_string.h"
9 : #include "ace/Truncate.h"
10 :
11 : #include <cstring>
12 :
13 : OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL
14 :
15 : namespace OpenDDS {
16 : namespace DCPS {
17 :
18 : #ifndef OPENDDS_SAFETY_PROFILE
19 : ACE_INLINE
20 116 : bool operator==(const DDS::UserDataQosPolicy& qos1,
21 : const DDS::UserDataQosPolicy& qos2)
22 : {
23 116 : return qos1.value == qos2.value;
24 : }
25 :
26 : ACE_INLINE
27 81 : bool operator==(const DDS::TopicDataQosPolicy& qos1,
28 : const DDS::TopicDataQosPolicy& qos2)
29 : {
30 81 : return qos1.value == qos2.value;
31 : }
32 :
33 : ACE_INLINE
34 81 : bool operator==(const DDS::GroupDataQosPolicy& qos1,
35 : const DDS::GroupDataQosPolicy& qos2)
36 : {
37 81 : return qos1.value == qos2.value;
38 : }
39 :
40 : ACE_INLINE
41 2 : bool operator==(const DDS::TransportPriorityQosPolicy& qos1,
42 : const DDS::TransportPriorityQosPolicy& qos2)
43 : {
44 2 : return qos1.value == qos2.value;
45 : }
46 :
47 : ACE_INLINE
48 44 : bool operator==(const DDS::LifespanQosPolicy& qos1,
49 : const DDS::LifespanQosPolicy& qos2)
50 : {
51 44 : return qos1.duration == qos2.duration;
52 : }
53 :
54 : ACE_INLINE
55 : bool
56 87 : operator==(const DDS::DurabilityQosPolicy& qos1,
57 : const DDS::DurabilityQosPolicy& qos2)
58 : {
59 87 : return qos1.kind == qos2.kind;
60 : }
61 :
62 : ACE_INLINE
63 : bool
64 44 : operator==(const DDS::DurabilityServiceQosPolicy& qos1,
65 : const DDS::DurabilityServiceQosPolicy& qos2)
66 : {
67 : return
68 44 : qos1.service_cleanup_delay == qos2.service_cleanup_delay
69 42 : && qos1.history_kind == qos2.history_kind
70 42 : && qos1.history_depth == qos2.history_depth
71 42 : && qos1.max_samples == qos2.max_samples
72 5 : && qos1.max_instances == qos2.max_instances
73 86 : && qos1.max_samples_per_instance == qos2.max_samples_per_instance;
74 : }
75 :
76 : ACE_INLINE
77 81 : bool operator==(const DDS::PresentationQosPolicy& qos1,
78 : const DDS::PresentationQosPolicy& qos2)
79 : {
80 : return
81 81 : qos1.access_scope == qos2.access_scope
82 77 : && qos1.coherent_access == qos2.coherent_access
83 158 : && qos1.ordered_access == qos2.ordered_access;
84 : }
85 :
86 : ACE_INLINE
87 85 : bool operator==(const DDS::DeadlineQosPolicy& qos1,
88 : const DDS::DeadlineQosPolicy& qos2)
89 : {
90 85 : return qos1.period == qos2.period;
91 : }
92 :
93 : ACE_INLINE
94 85 : bool operator==(const DDS::LatencyBudgetQosPolicy& qos1,
95 : const DDS::LatencyBudgetQosPolicy& qos2)
96 : {
97 85 : return qos1.duration == qos2.duration;
98 : }
99 :
100 : ACE_INLINE
101 83 : bool operator==(const DDS::OwnershipQosPolicy& qos1,
102 : const DDS::OwnershipQosPolicy& qos2)
103 : {
104 83 : return qos1.kind == qos2.kind;
105 : }
106 :
107 : ACE_INLINE
108 44 : bool operator==(const DDS::OwnershipStrengthQosPolicy& qos1,
109 : const DDS::OwnershipStrengthQosPolicy& qos2)
110 : {
111 44 : return qos1.value == qos2.value;
112 : }
113 :
114 : ACE_INLINE
115 85 : bool operator==(const DDS::LivelinessQosPolicy& qos1,
116 : const DDS::LivelinessQosPolicy& qos2)
117 : {
118 : return
119 85 : qos1.kind == qos2.kind
120 85 : && qos1.lease_duration == qos2.lease_duration;
121 : }
122 :
123 : ACE_INLINE
124 41 : bool operator==(const DDS::TimeBasedFilterQosPolicy& qos1,
125 : const DDS::TimeBasedFilterQosPolicy& qos2)
126 : {
127 41 : return qos1.minimum_separation == qos2.minimum_separation;
128 : }
129 :
130 : ACE_INLINE
131 81 : bool operator==(const DDS::PartitionQosPolicy& qos1,
132 : const DDS::PartitionQosPolicy& qos2)
133 : {
134 81 : const CORBA::ULong len = qos1.name.length();
135 :
136 81 : if (len == qos2.name.length()) {
137 77 : for (CORBA::ULong i = 0; i < len; ++i) {
138 0 : if (0 != ACE_OS::strcmp(qos1.name[i], qos2.name[i])) {
139 0 : return false;
140 : }
141 : }
142 :
143 77 : return true;
144 : }
145 :
146 4 : return false;
147 : }
148 :
149 : ACE_INLINE
150 4 : bool operator==(const DDS::ReliabilityQosPolicy& qos1,
151 : const DDS::ReliabilityQosPolicy& qos2)
152 : {
153 : return
154 4 : qos1.kind == qos2.kind
155 4 : && qos1.max_blocking_time == qos2.max_blocking_time;
156 : }
157 :
158 : ACE_INLINE
159 85 : bool operator==(const DDS::DestinationOrderQosPolicy& qos1,
160 : const DDS::DestinationOrderQosPolicy& qos2)
161 : {
162 85 : return qos1.kind == qos2.kind;
163 : }
164 :
165 : ACE_INLINE
166 4 : bool operator==(const DDS::HistoryQosPolicy& qos1,
167 : const DDS::HistoryQosPolicy& qos2)
168 : {
169 : return
170 4 : qos1.kind == qos2.kind
171 4 : && qos1.depth == qos2.depth;
172 : }
173 :
174 : ACE_INLINE
175 4 : bool operator==(const DDS::ResourceLimitsQosPolicy& qos1,
176 : const DDS::ResourceLimitsQosPolicy& qos2)
177 : {
178 : return
179 4 : qos1.max_samples == qos2.max_samples
180 4 : && qos1.max_instances == qos2.max_instances
181 8 : && qos1.max_samples_per_instance == qos2.max_samples_per_instance;
182 : }
183 :
184 : ACE_INLINE
185 0 : bool operator==(const DDS::EntityFactoryQosPolicy& qos1,
186 : const DDS::EntityFactoryQosPolicy& qos2)
187 : {
188 : // Marked_Default_Qos for DomainParticipant uses a value that's not 0 or 1
189 0 : return std::memcmp(&qos1.autoenable_created_entities,
190 0 : &qos2.autoenable_created_entities,
191 0 : sizeof qos2.autoenable_created_entities) == 0;
192 : }
193 :
194 : ACE_INLINE
195 2 : bool operator==(const DDS::WriterDataLifecycleQosPolicy& qos1,
196 : const DDS::WriterDataLifecycleQosPolicy& qos2)
197 : {
198 : return
199 2 : qos1.autodispose_unregistered_instances == qos2.autodispose_unregistered_instances;
200 : }
201 :
202 : ACE_INLINE
203 2 : bool operator==(const DDS::ReaderDataLifecycleQosPolicy& qos1,
204 : const DDS::ReaderDataLifecycleQosPolicy& qos2)
205 : {
206 : return
207 2 : (qos1.autopurge_nowriter_samples_delay == qos2.autopurge_nowriter_samples_delay)
208 2 : && (qos1.autopurge_disposed_samples_delay == qos2.autopurge_disposed_samples_delay);
209 : }
210 :
211 : template <typename T>
212 : ACE_INLINE
213 0 : bool operator==(const TAO::unbounded_value_sequence<T>& seq1, const TAO::unbounded_value_sequence<T>& seq2)
214 : {
215 0 : if (seq1.length() != seq2.length()) {
216 0 : return false;
217 : }
218 :
219 0 : for (unsigned int i = 0; i < seq1.length(); ++i) {
220 0 : if (seq1[i].name != seq2[i].name || seq1[i].value != seq2[i].value || seq1[i].propagate != seq2[i].propagate) {
221 0 : return false;
222 : }
223 : }
224 0 : return true;
225 : }
226 :
227 : ACE_INLINE
228 0 : bool operator==(const DDS::PropertyQosPolicy& qos1,
229 : const DDS::PropertyQosPolicy& qos2)
230 : {
231 0 : return qos1.value == qos2.value && qos1.binary_value == qos2.binary_value;
232 : }
233 :
234 : ACE_INLINE
235 0 : bool operator==(const DDS::DomainParticipantQos& qos1,
236 : const DDS::DomainParticipantQos& qos2)
237 : {
238 : return
239 0 : qos1.user_data == qos2.user_data
240 0 : && qos1.entity_factory == qos2.entity_factory
241 0 : && qos1.property == qos2.property;
242 : }
243 :
244 : ACE_INLINE
245 0 : bool operator==(const DDS::TopicQos& qos1,
246 : const DDS::TopicQos& qos2)
247 : {
248 : return
249 0 : qos1.topic_data == qos2.topic_data
250 0 : && qos1.durability == qos2.durability
251 0 : && qos1.durability_service == qos2.durability_service
252 0 : && qos1.deadline == qos2.deadline
253 0 : && qos1.latency_budget == qos2.latency_budget
254 0 : && qos1.liveliness == qos2.liveliness
255 0 : && qos1.reliability == qos2.reliability
256 0 : && qos1.destination_order == qos2.destination_order
257 0 : && qos1.history == qos2.history
258 0 : && qos1.resource_limits == qos2.resource_limits
259 0 : && qos1.transport_priority == qos2.transport_priority
260 0 : && qos1.lifespan == qos2.lifespan
261 0 : && qos1.ownership == qos2.ownership
262 0 : && qos1.representation == qos2.representation;
263 : }
264 :
265 : ACE_INLINE
266 3 : bool operator==(const DDS::DataWriterQos& qos1,
267 : const DDS::DataWriterQos& qos2)
268 : {
269 : return
270 3 : qos1.durability == qos2.durability
271 2 : && qos1.durability_service == qos2.durability_service
272 2 : && qos1.deadline == qos2.deadline
273 2 : && qos1.latency_budget == qos2.latency_budget
274 2 : && qos1.liveliness == qos2.liveliness
275 2 : && qos1.reliability == qos2.reliability
276 2 : && qos1.destination_order == qos2.destination_order
277 2 : && qos1.history == qos2.history
278 2 : && qos1.resource_limits == qos2.resource_limits
279 2 : && qos1.transport_priority == qos2.transport_priority
280 2 : && qos1.lifespan == qos2.lifespan
281 2 : && qos1.user_data == qos2.user_data
282 2 : && qos1.ownership == qos2.ownership
283 : #ifndef OPENDDS_NO_OWNERSHIP_KIND_EXCLUSIVE
284 2 : && qos1.ownership_strength == qos2.ownership_strength
285 : #endif
286 2 : && qos1.writer_data_lifecycle == qos2.writer_data_lifecycle
287 5 : && qos1.representation == qos2.representation;
288 : }
289 :
290 : ACE_INLINE
291 0 : bool operator==(const DDS::PublisherQos& qos1,
292 : const DDS::PublisherQos& qos2)
293 : {
294 : return
295 0 : qos1.presentation == qos2.presentation
296 0 : && qos1.partition == qos2.partition
297 0 : && qos1.group_data == qos2.group_data
298 0 : && qos1.entity_factory == qos2.entity_factory;
299 : }
300 :
301 : ACE_INLINE
302 3 : bool operator==(const DDS::DataReaderQos& qos1,
303 : const DDS::DataReaderQos& qos2)
304 : {
305 : return
306 3 : qos1.durability == qos2.durability
307 2 : && qos1.deadline == qos2.deadline
308 2 : && qos1.latency_budget == qos2.latency_budget
309 2 : && qos1.liveliness == qos2.liveliness
310 2 : && qos1.reliability == qos2.reliability
311 2 : && qos1.destination_order == qos2.destination_order
312 2 : && qos1.history == qos2.history
313 2 : && qos1.resource_limits == qos2.resource_limits
314 2 : && qos1.user_data == qos2.user_data
315 2 : && qos1.time_based_filter == qos2.time_based_filter
316 2 : && qos1.reader_data_lifecycle == qos2.reader_data_lifecycle
317 5 : && qos1.representation == qos2.representation;
318 : }
319 :
320 : ACE_INLINE
321 0 : bool operator==(const DDS::SubscriberQos& qos1,
322 : const DDS::SubscriberQos& qos2)
323 : {
324 : return
325 0 : qos1.presentation == qos2.presentation
326 0 : && qos1.partition == qos2.partition
327 0 : && qos1.group_data == qos2.group_data
328 0 : && qos1.entity_factory == qos2.entity_factory;
329 : }
330 :
331 : ACE_INLINE
332 0 : bool operator==(const DDS::DomainParticipantFactoryQos& qos1,
333 : const DDS::DomainParticipantFactoryQos& qos2)
334 : {
335 0 : return qos1.entity_factory == qos2.entity_factory;
336 : }
337 :
338 : ACE_INLINE
339 4 : bool operator==(const DDS::DataRepresentationQosPolicy& qos1,
340 : const DDS::DataRepresentationQosPolicy& qos2)
341 : {
342 4 : const CORBA::ULong count = qos1.value.length();
343 4 : const CORBA::ULong count2 = qos2.value.length();
344 4 : if (count != count2) {
345 0 : return false;
346 : }
347 4 : for (CORBA::ULong i = 0; i < count; ++i) {
348 0 : if (qos1.value[i] != qos2.value[i]) {
349 0 : return false;
350 : }
351 : }
352 4 : return true;
353 : }
354 :
355 : ACE_INLINE
356 39 : bool operator==(const DDS::TypeConsistencyEnforcementQosPolicy& qos1,
357 : const DDS::TypeConsistencyEnforcementQosPolicy& qos2)
358 : {
359 39 : return qos1.kind == qos2.kind
360 0 : && qos1.ignore_sequence_bounds == qos2.ignore_sequence_bounds
361 0 : && qos1.ignore_string_bounds == qos2.ignore_string_bounds
362 0 : && qos1.ignore_member_names == qos2.ignore_member_names
363 0 : && qos1.prevent_type_widening == qos2.prevent_type_widening
364 39 : && qos1.force_type_validation == qos2.force_type_validation;
365 : }
366 :
367 : ACE_INLINE
368 112 : bool operator!=(const DDS::UserDataQosPolicy& qos1,
369 : const DDS::UserDataQosPolicy& qos2)
370 : {
371 112 : return !(qos1 == qos2);
372 : }
373 :
374 : ACE_INLINE
375 81 : bool operator!=(const DDS::TopicDataQosPolicy& qos1,
376 : const DDS::TopicDataQosPolicy& qos2)
377 : {
378 81 : return !(qos1 == qos2);
379 : }
380 :
381 : ACE_INLINE
382 81 : bool operator!=(const DDS::GroupDataQosPolicy& qos1,
383 : const DDS::GroupDataQosPolicy& qos2)
384 : {
385 81 : return !(qos1 == qos2);
386 : }
387 :
388 : ACE_INLINE
389 0 : bool operator!=(const DDS::TransportPriorityQosPolicy& qos1,
390 : const DDS::TransportPriorityQosPolicy& qos2)
391 : {
392 0 : return !(qos1 == qos2);
393 : }
394 :
395 : ACE_INLINE
396 42 : bool operator!=(const DDS::LifespanQosPolicy& qos1,
397 : const DDS::LifespanQosPolicy& qos2)
398 : {
399 42 : return !(qos1 == qos2);
400 : }
401 :
402 : ACE_INLINE
403 : bool
404 81 : operator!=(const DDS::DurabilityQosPolicy& qos1,
405 : const DDS::DurabilityQosPolicy& qos2)
406 : {
407 81 : return !(qos1 == qos2);
408 : }
409 :
410 : ACE_INLINE
411 : bool
412 42 : operator!=(const DDS::DurabilityServiceQosPolicy& qos1,
413 : const DDS::DurabilityServiceQosPolicy& qos2)
414 : {
415 42 : return !(qos1 == qos2);
416 : }
417 :
418 : ACE_INLINE
419 81 : bool operator!=(const DDS::PresentationQosPolicy& qos1,
420 : const DDS::PresentationQosPolicy& qos2)
421 : {
422 81 : return !(qos1 == qos2);
423 : }
424 :
425 : ACE_INLINE
426 81 : bool operator!=(const DDS::DeadlineQosPolicy& qos1,
427 : const DDS::DeadlineQosPolicy& qos2)
428 : {
429 81 : return !(qos1 == qos2);
430 : }
431 :
432 : ACE_INLINE
433 81 : bool operator!=(const DDS::LatencyBudgetQosPolicy& qos1,
434 : const DDS::LatencyBudgetQosPolicy& qos2)
435 : {
436 81 : return !(qos1 == qos2);
437 : }
438 :
439 : ACE_INLINE
440 81 : bool operator!=(const DDS::OwnershipQosPolicy& qos1,
441 : const DDS::OwnershipQosPolicy& qos2)
442 : {
443 81 : return !(qos1 == qos2);
444 : }
445 :
446 : ACE_INLINE
447 42 : bool operator!=(const DDS::OwnershipStrengthQosPolicy& qos1,
448 : const DDS::OwnershipStrengthQosPolicy& qos2)
449 : {
450 42 : return !(qos1 == qos2);
451 : }
452 :
453 : ACE_INLINE
454 81 : bool operator!=(const DDS::LivelinessQosPolicy& qos1,
455 : const DDS::LivelinessQosPolicy& qos2)
456 : {
457 81 : return !(qos1 == qos2);
458 : }
459 :
460 : ACE_INLINE
461 39 : bool operator!=(const DDS::TimeBasedFilterQosPolicy& qos1,
462 : const DDS::TimeBasedFilterQosPolicy& qos2)
463 : {
464 39 : return !(qos1 == qos2);
465 : }
466 :
467 : ACE_INLINE
468 81 : bool operator!=(const DDS::PartitionQosPolicy& qos1,
469 : const DDS::PartitionQosPolicy& qos2)
470 : {
471 81 : return !(qos1 == qos2);
472 : }
473 :
474 : ACE_INLINE
475 0 : bool operator!=(const DDS::ReliabilityQosPolicy& qos1,
476 : const DDS::ReliabilityQosPolicy& qos2)
477 : {
478 0 : return !(qos1 == qos2);
479 : }
480 :
481 : ACE_INLINE
482 81 : bool operator!=(const DDS::DestinationOrderQosPolicy& qos1,
483 : const DDS::DestinationOrderQosPolicy& qos2)
484 : {
485 81 : return !(qos1 == qos2);
486 : }
487 :
488 : ACE_INLINE
489 : bool operator!=(const DDS::HistoryQosPolicy& qos1,
490 : const DDS::HistoryQosPolicy& qos2)
491 : {
492 : return !(qos1 == qos2);
493 : }
494 :
495 : ACE_INLINE
496 : bool operator!=(const DDS::ResourceLimitsQosPolicy& qos1,
497 : const DDS::ResourceLimitsQosPolicy& qos2)
498 : {
499 : return !(qos1 == qos2);
500 : }
501 :
502 : ACE_INLINE
503 : bool operator!=(const DDS::EntityFactoryQosPolicy& qos1,
504 : const DDS::EntityFactoryQosPolicy& qos2)
505 : {
506 : return !(qos1 == qos2);
507 : }
508 :
509 : ACE_INLINE
510 : bool operator!=(const DDS::WriterDataLifecycleQosPolicy& qos1,
511 : const DDS::WriterDataLifecycleQosPolicy& qos2)
512 : {
513 : return !(qos1 == qos2);
514 : }
515 :
516 : ACE_INLINE
517 : bool operator!=(const DDS::ReaderDataLifecycleQosPolicy& qos1,
518 : const DDS::ReaderDataLifecycleQosPolicy& qos2)
519 : {
520 : return !(qos1 == qos2);
521 : }
522 :
523 : ACE_INLINE
524 : bool operator!=(const DDS::PropertyQosPolicy& qos1,
525 : const DDS::PropertyQosPolicy& qos2)
526 : {
527 : return !(qos1 == qos2);
528 : }
529 :
530 : ACE_INLINE
531 : bool operator!=(const DDS::DomainParticipantQos& qos1,
532 : const DDS::DomainParticipantQos& qos2)
533 : {
534 : return !(qos1 == qos2);
535 : }
536 :
537 : ACE_INLINE
538 : bool operator!=(const DDS::TopicQos& qos1,
539 : const DDS::TopicQos& qos2)
540 : {
541 : return !(qos1 == qos2);
542 : }
543 :
544 : ACE_INLINE
545 0 : bool operator!=(const DDS::DataWriterQos& qos1,
546 : const DDS::DataWriterQos& qos2)
547 : {
548 0 : return !(qos1 == qos2);
549 : }
550 :
551 : ACE_INLINE
552 : bool operator!=(const DDS::PublisherQos& qos1,
553 : const DDS::PublisherQos& qos2)
554 : {
555 : return !(qos1 == qos2);
556 : }
557 :
558 : ACE_INLINE
559 0 : bool operator!=(const DDS::DataReaderQos& qos1,
560 : const DDS::DataReaderQos& qos2)
561 : {
562 0 : return !(qos1 == qos2);
563 : }
564 :
565 : ACE_INLINE
566 0 : bool operator!=(const DDS::SubscriberQos& qos1,
567 : const DDS::SubscriberQos& qos2)
568 : {
569 0 : return !(qos1 == qos2);
570 : }
571 :
572 : ACE_INLINE
573 : bool operator!=(const DDS::DomainParticipantFactoryQos& qos1,
574 : const DDS::DomainParticipantFactoryQos& qos2)
575 : {
576 : return !(qos1 == qos2);
577 : }
578 :
579 : ACE_INLINE
580 : bool operator!=(const DDS::DataRepresentationQosPolicy& qos1,
581 : const DDS::DataRepresentationQosPolicy& qos2)
582 : {
583 : return !(qos1 == qos2);
584 : }
585 :
586 : ACE_INLINE
587 39 : bool operator!=(const DDS::TypeConsistencyEnforcementQosPolicy& qos1,
588 : const DDS::TypeConsistencyEnforcementQosPolicy& qos2)
589 : {
590 39 : return !(qos1 == qos2);
591 : }
592 : #endif
593 :
594 : ACE_INLINE
595 : bool
596 0 : Qos_Helper::consistent(
597 : const DDS::ResourceLimitsQosPolicy& resource_limits,
598 : const DDS::HistoryQosPolicy& history)
599 : {
600 0 : CORBA::Long const max_samples_per_instance =
601 : resource_limits.max_samples_per_instance;
602 0 : CORBA::Long const max_samples = resource_limits.max_samples;
603 :
604 : return
605 : (max_samples_per_instance == DDS::LENGTH_UNLIMITED
606 0 : || (max_samples_per_instance >= history.depth
607 0 : && (max_samples == DDS::LENGTH_UNLIMITED
608 0 : || max_samples >= max_samples_per_instance)));
609 : }
610 :
611 : ACE_INLINE
612 : bool
613 0 : Qos_Helper::consistent(const DDS::DeadlineQosPolicy& deadline,
614 : const DDS::TimeBasedFilterQosPolicy& time_based_filter)
615 : {
616 0 : return time_based_filter.minimum_separation <= deadline.period;
617 : }
618 :
619 : ACE_INLINE
620 0 : bool Qos_Helper::consistent(const DDS::DomainParticipantQos& /* qos */)
621 : {
622 0 : return true;
623 : }
624 :
625 : ACE_INLINE
626 0 : bool Qos_Helper::consistent(const DDS::TopicQos& qos)
627 : {
628 : // Leverage existing validation functions for related QoS
629 : // policies.
630 :
631 : #ifndef OPENDDS_NO_PERSISTENCE_PROFILE
632 : DDS::HistoryQosPolicy const ds_history = {
633 0 : qos.durability_service.history_kind,
634 0 : qos.durability_service.history_depth
635 0 : };
636 :
637 : DDS::ResourceLimitsQosPolicy const ds_resource_limits = {
638 0 : qos.durability_service.max_samples,
639 0 : qos.durability_service.max_instances,
640 0 : qos.durability_service.max_samples_per_instance
641 0 : };
642 :
643 : return
644 0 : consistent(qos.resource_limits, qos.history)
645 0 : && consistent(ds_resource_limits, ds_history);
646 : #else
647 : ACE_UNUSED_ARG(qos);
648 : return true;
649 : #endif
650 : }
651 :
652 : ACE_INLINE
653 : bool
654 0 : Qos_Helper::consistent(const DDS::DataWriterQos& qos)
655 : {
656 : // Leverage existing validation functions for related QoS
657 : // policies.
658 :
659 : #ifndef OPENDDS_NO_PERSISTENCE_PROFILE
660 : DDS::HistoryQosPolicy const ds_history = {
661 0 : qos.durability_service.history_kind,
662 0 : qos.durability_service.history_depth
663 0 : };
664 :
665 : DDS::ResourceLimitsQosPolicy const ds_resource_limits = {
666 0 : qos.durability_service.max_samples,
667 0 : qos.durability_service.max_instances,
668 0 : qos.durability_service.max_samples_per_instance
669 0 : };
670 :
671 : return
672 0 : consistent(qos.resource_limits, qos.history)
673 0 : && consistent(ds_resource_limits, ds_history);
674 : #else
675 : ACE_UNUSED_ARG(qos);
676 : return true;
677 : #endif
678 : }
679 :
680 : ACE_INLINE
681 : bool
682 0 : Qos_Helper::consistent(const DDS::PublisherQos& /* qos */)
683 : {
684 0 : return true;
685 : }
686 :
687 : ACE_INLINE
688 : bool
689 0 : Qos_Helper::consistent(const DDS::DataReaderQos& qos)
690 : {
691 : return
692 0 : consistent(qos.deadline, qos.time_based_filter) &&
693 0 : consistent(qos.resource_limits, qos.history);
694 : }
695 :
696 : ACE_INLINE
697 : bool
698 0 : Qos_Helper::consistent(const DDS::SubscriberQos& /* qos */)
699 : {
700 0 : return true;
701 : }
702 :
703 : ACE_INLINE
704 : bool
705 0 : Qos_Helper::consistent(const DDS::DomainParticipantFactoryQos& /* qos */)
706 : {
707 0 : return true;
708 : }
709 :
710 : // Note: Since in the first implmenation of DSS in TAO
711 : // a limited number of QoS values are allowed to be
712 : // modified, the validity tests are simplified to mostly
713 : // being a check that they are the defaults defined in
714 : // the specification.
715 : // SO INVALID ALSO INCLUDES UNSUPPORTED QoS.
716 : // TBD - when QoS become support the valid checks should check
717 : // the ranges of the values of the QoS.
718 :
719 : // The spec does not have specification about the content of
720 : // UserDataQosPolicy,TopicDataQosPolicy and GroupDataQosPolicy
721 : // so they are valid with any value.
722 : ACE_INLINE
723 0 : bool Qos_Helper::valid(const DDS::UserDataQosPolicy& /* qos */)
724 : {
725 0 : return true;
726 : }
727 :
728 : ACE_INLINE
729 0 : bool Qos_Helper::valid(const DDS::TopicDataQosPolicy & /* qos */)
730 : {
731 0 : return true;
732 : }
733 :
734 : ACE_INLINE
735 0 : bool Qos_Helper::valid(const DDS::GroupDataQosPolicy& /* qos */)
736 : {
737 0 : return true;
738 : }
739 :
740 : // All values of TRANSPORT_PRIORITY.value are accepted.
741 : ACE_INLINE
742 0 : bool Qos_Helper::valid(const DDS::TransportPriorityQosPolicy& /* qos */)
743 : {
744 0 : return true;
745 : }
746 :
747 : ACE_INLINE
748 0 : bool Qos_Helper::valid(const DDS::LifespanQosPolicy& qos)
749 : {
750 0 : return valid_duration(qos.duration);
751 : }
752 :
753 : ACE_INLINE
754 : bool
755 0 : Qos_Helper::valid(const DDS::DurabilityQosPolicy& qos)
756 : {
757 : return
758 0 : (qos.kind == DDS::VOLATILE_DURABILITY_QOS
759 0 : || qos.kind == DDS::TRANSIENT_LOCAL_DURABILITY_QOS
760 0 : || qos.kind == DDS::TRANSIENT_DURABILITY_QOS
761 0 : || qos.kind == DDS::PERSISTENT_DURABILITY_QOS);
762 : }
763 :
764 : ACE_INLINE
765 0 : bool Qos_Helper::valid(const DDS::PresentationQosPolicy& qos)
766 : {
767 : return
768 0 : (qos.access_scope == DDS::INSTANCE_PRESENTATION_QOS
769 0 : || qos.access_scope == DDS::TOPIC_PRESENTATION_QOS
770 0 : || qos.access_scope == DDS::GROUP_PRESENTATION_QOS);
771 : }
772 :
773 : ACE_INLINE
774 0 : bool Qos_Helper::valid(const DDS::DeadlineQosPolicy& qos)
775 : {
776 0 : return valid_duration(qos.period);
777 : }
778 :
779 : ACE_INLINE
780 0 : bool Qos_Helper::valid(const DDS::LatencyBudgetQosPolicy& /* qos */)
781 : {
782 0 : return true;
783 : }
784 :
785 : ACE_INLINE
786 0 : bool Qos_Helper::valid(const DDS::OwnershipQosPolicy& qos)
787 : {
788 : return
789 0 : qos.kind == DDS::SHARED_OWNERSHIP_QOS
790 : #ifndef OPENDDS_NO_OWNERSHIP_KIND_EXCLUSIVE
791 0 : || qos.kind == DDS::EXCLUSIVE_OWNERSHIP_QOS
792 : #endif
793 : ;
794 : }
795 :
796 : #ifndef OPENDDS_NO_OWNERSHIP_KIND_EXCLUSIVE
797 : ACE_INLINE
798 0 : bool Qos_Helper::valid(const DDS::OwnershipStrengthQosPolicy& /*qos*/)
799 : {
800 0 : return true;
801 : }
802 : #endif
803 :
804 : ACE_INLINE
805 0 : bool Qos_Helper::valid(const DDS::LivelinessQosPolicy& qos)
806 : {
807 : return
808 0 : (qos.kind == DDS::AUTOMATIC_LIVELINESS_QOS
809 0 : || qos.kind == DDS::MANUAL_BY_PARTICIPANT_LIVELINESS_QOS
810 0 : || qos.kind == DDS::MANUAL_BY_TOPIC_LIVELINESS_QOS)
811 :
812 0 : && valid_duration(qos.lease_duration);
813 : }
814 :
815 : ACE_INLINE
816 0 : bool Qos_Helper::valid(const DDS::TimeBasedFilterQosPolicy& /*qos*/)
817 : {
818 0 : return true;
819 : }
820 :
821 : ACE_INLINE
822 : bool
823 0 : Qos_Helper::valid(const DDS::PartitionQosPolicy& /* qos */)
824 : {
825 : // All strings are valid, although we may not accept all
826 : // wildcard patterns. For now we treat unsupported wildcard
827 : // patterns literally instead of as wildcards.
828 0 : return true;
829 : }
830 :
831 : ACE_INLINE
832 0 : bool Qos_Helper::valid(const DDS::ReliabilityQosPolicy& qos)
833 : {
834 : return
835 0 : qos.kind == DDS::BEST_EFFORT_RELIABILITY_QOS
836 0 : || qos.kind == DDS::RELIABLE_RELIABILITY_QOS;
837 : }
838 :
839 : ACE_INLINE
840 0 : bool Qos_Helper::valid(const DDS::DestinationOrderQosPolicy& qos)
841 : {
842 0 : return qos.kind == DDS::BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS
843 0 : || qos.kind == DDS::BY_SOURCE_TIMESTAMP_DESTINATIONORDER_QOS;
844 : }
845 :
846 : ACE_INLINE
847 : bool
848 0 : Qos_Helper::valid(const DDS::HistoryQosPolicy& qos)
849 : {
850 : return
851 0 : (qos.kind == DDS::KEEP_LAST_HISTORY_QOS
852 0 : || qos.kind == DDS::KEEP_ALL_HISTORY_QOS)
853 0 : && (qos.depth == DDS::LENGTH_UNLIMITED
854 0 : || qos.depth > 0);
855 : }
856 :
857 : ACE_INLINE
858 : bool
859 0 : Qos_Helper::valid(const DDS::ResourceLimitsQosPolicy& qos)
860 : {
861 : return
862 0 : (qos.max_samples == DDS::LENGTH_UNLIMITED
863 0 : || qos.max_samples > 0)
864 0 : && (qos.max_instances == DDS::LENGTH_UNLIMITED
865 0 : || qos.max_instances > 0)
866 0 : && (qos.max_samples_per_instance == DDS::LENGTH_UNLIMITED
867 0 : || qos.max_samples_per_instance > 0);
868 : }
869 :
870 : #ifndef OPENDDS_NO_PERSISTENCE_PROFILE
871 : ACE_INLINE
872 : bool
873 0 : Qos_Helper::valid(const DDS::DurabilityServiceQosPolicy& qos)
874 : {
875 : // Leverage existing validation functions for related QoS
876 : // policies.
877 : DDS::HistoryQosPolicy const history = {
878 0 : qos.history_kind,
879 0 : qos.history_depth
880 0 : };
881 :
882 : DDS::ResourceLimitsQosPolicy const resource_limits = {
883 0 : qos.max_samples,
884 0 : qos.max_instances,
885 0 : qos.max_samples_per_instance
886 0 : };
887 :
888 : return
889 0 : non_negative_duration(qos.service_cleanup_delay)
890 0 : && valid(history)
891 0 : && valid(resource_limits);
892 : }
893 : #endif
894 :
895 : ACE_INLINE
896 0 : bool Qos_Helper::valid(const DDS::EntityFactoryQosPolicy& qos)
897 : {
898 : // see Marked_Default_Qos::marked_default_DomainParticipantQos()
899 0 : const void* const mem = &qos.autoenable_created_entities;
900 0 : return *static_cast<const char*>(mem) != 3;
901 : }
902 :
903 : ACE_INLINE
904 0 : bool Qos_Helper::valid(const DDS::PropertyQosPolicy& /* qos */)
905 : {
906 0 : return true;
907 : }
908 :
909 : ACE_INLINE
910 0 : bool Qos_Helper::valid(const DDS::WriterDataLifecycleQosPolicy&)
911 : {
912 0 : return true;
913 : }
914 :
915 : ACE_INLINE
916 0 : bool Qos_Helper::valid(const DDS::ReaderDataLifecycleQosPolicy&)
917 : {
918 0 : return true;
919 : }
920 :
921 : ACE_INLINE
922 0 : bool Qos_Helper::valid(const DDS::DataRepresentationQosPolicy& qos)
923 : {
924 0 : const CORBA::ULong count = qos.value.length();
925 :
926 0 : for (CORBA::ULong i = 0; i < count; ++i) {
927 0 : const CORBA::Short value = qos.value[i];
928 :
929 0 : switch (value) {
930 0 : case DDS::XCDR_DATA_REPRESENTATION:
931 : case DDS::XML_DATA_REPRESENTATION:
932 : case DDS::XCDR2_DATA_REPRESENTATION:
933 : case OpenDDS::DCPS::UNALIGNED_CDR_DATA_REPRESENTATION:
934 0 : break;
935 :
936 0 : default:
937 0 : ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ")
938 : ACE_TEXT("Qos_Helper::valid(const DataRepresentationQosPolicy&): ")
939 : ACE_TEXT("Unknown DataRepresentationId_t: %d\n"), value));
940 0 : return false;
941 : };
942 : }
943 :
944 0 : return true;
945 : }
946 :
947 : ACE_INLINE
948 0 : bool Qos_Helper::changeable(const DDS::UserDataQosPolicy& /* qos1 */,
949 : const DDS::UserDataQosPolicy& /* qos2 */)
950 : {
951 0 : return true;
952 : }
953 :
954 : ACE_INLINE
955 0 : bool Qos_Helper::changeable(const DDS::TopicDataQosPolicy & /* qos1 */,
956 : const DDS::TopicDataQosPolicy & /* qos2 */)
957 : {
958 0 : return true;
959 : }
960 :
961 : ACE_INLINE
962 0 : bool Qos_Helper::changeable(const DDS::GroupDataQosPolicy& /* qos1 */,
963 : const DDS::GroupDataQosPolicy& /* qos2 */)
964 : {
965 0 : return true;
966 : }
967 :
968 : ACE_INLINE
969 0 : bool Qos_Helper::changeable(
970 : const DDS::TransportPriorityQosPolicy& qos1,
971 : const DDS::TransportPriorityQosPolicy& qos2)
972 : {
973 : // formal/07-01-01 specifies that this is changeable. OpenDDS as
974 : // of Version 1.3 does not support dynamic modification of the
975 : // priority of a single DataWriter TRANSPORT_PRIORITY.value.
976 : //
977 : // return true;
978 0 : return qos1 == qos2;
979 : }
980 :
981 : ACE_INLINE
982 : bool
983 0 : Qos_Helper::changeable(const DDS::LifespanQosPolicy& /* qos1 */,
984 : const DDS::LifespanQosPolicy& /* qos2 */)
985 : {
986 0 : return true;
987 : }
988 :
989 : ACE_INLINE
990 0 : bool Qos_Helper::changeable(const DDS::DurabilityQosPolicy& qos1,
991 : const DDS::DurabilityQosPolicy& qos2)
992 : {
993 0 : return qos1 == qos2;
994 : }
995 :
996 : #ifndef OPENDDS_NO_PERSISTENCE_PROFILE
997 : ACE_INLINE
998 : bool
999 0 : Qos_Helper::changeable(const DDS::DurabilityServiceQosPolicy& qos1,
1000 : const DDS::DurabilityServiceQosPolicy& qos2)
1001 : {
1002 0 : return qos1 == qos2;
1003 : }
1004 : #endif
1005 :
1006 : ACE_INLINE
1007 0 : bool Qos_Helper::changeable(const DDS::PresentationQosPolicy& qos1,
1008 : const DDS::PresentationQosPolicy& qos2)
1009 : {
1010 0 : return qos1 == qos2;
1011 : }
1012 :
1013 : // ---------------------------------------------------------------
1014 : /**
1015 : * TBD: These QoS are not supported currently, they are
1016 : * changeable, but need a compatibility check between the
1017 : * publisher and subscriber ends when changing the QoS.
1018 : */
1019 : // ---------------------------------------------------------------
1020 : ACE_INLINE
1021 0 : bool Qos_Helper::changeable(const DDS::DeadlineQosPolicy& /* qos1 */,
1022 : const DDS::DeadlineQosPolicy& /* qos2 */)
1023 : {
1024 0 : return true;
1025 : }
1026 :
1027 : ACE_INLINE
1028 0 : bool Qos_Helper::changeable(
1029 : const DDS::LatencyBudgetQosPolicy& /* qos1 */,
1030 : const DDS::LatencyBudgetQosPolicy& /* qos2 */)
1031 : {
1032 0 : return true;
1033 : }
1034 :
1035 : ACE_INLINE
1036 0 : bool Qos_Helper::changeable(const DDS::OwnershipQosPolicy& qos1,
1037 : const DDS::OwnershipQosPolicy& qos2)
1038 : {
1039 0 : return qos1 == qos2;
1040 : }
1041 : // ---------------------------------------------------------------
1042 :
1043 : #ifndef OPENDDS_NO_OWNERSHIP_KIND_EXCLUSIVE
1044 : ACE_INLINE
1045 0 : bool Qos_Helper::changeable(
1046 : const DDS::OwnershipStrengthQosPolicy& /* qos1 */,
1047 : const DDS::OwnershipStrengthQosPolicy& /* qos2 */)
1048 : {
1049 0 : return true;
1050 : }
1051 : #endif
1052 :
1053 : ACE_INLINE
1054 0 : bool Qos_Helper::changeable(const DDS::LivelinessQosPolicy& qos1,
1055 : const DDS::LivelinessQosPolicy& qos2)
1056 : {
1057 0 : return qos1 == qos2;
1058 : }
1059 :
1060 : ACE_INLINE
1061 0 : bool Qos_Helper::changeable(
1062 : const DDS::TimeBasedFilterQosPolicy& /* qos1 */,
1063 : const DDS::TimeBasedFilterQosPolicy& /* qos2*/)
1064 : {
1065 0 : return true;
1066 : }
1067 :
1068 : ACE_INLINE
1069 : bool
1070 0 : Qos_Helper::changeable(const DDS::PartitionQosPolicy& /* qos1 */,
1071 : const DDS::PartitionQosPolicy& /* qos2 */)
1072 : {
1073 0 : return true;
1074 : }
1075 :
1076 : ACE_INLINE
1077 0 : bool Qos_Helper::changeable(const DDS::ReliabilityQosPolicy& qos1,
1078 : const DDS::ReliabilityQosPolicy& qos2)
1079 : {
1080 0 : return qos1 == qos2;
1081 : }
1082 :
1083 : ACE_INLINE
1084 0 : bool Qos_Helper::changeable(const DDS::DestinationOrderQosPolicy& qos1,
1085 : const DDS::DestinationOrderQosPolicy& qos2)
1086 : {
1087 0 : return qos1 == qos2;
1088 : }
1089 :
1090 : ACE_INLINE
1091 0 : bool Qos_Helper::changeable(const DDS::HistoryQosPolicy& qos1,
1092 : const DDS::HistoryQosPolicy& qos2)
1093 : {
1094 0 : return qos1 == qos2;
1095 : }
1096 :
1097 : ACE_INLINE
1098 0 : bool Qos_Helper::changeable(const DDS::ResourceLimitsQosPolicy& qos1,
1099 : const DDS::ResourceLimitsQosPolicy& qos2)
1100 : {
1101 0 : return qos1 == qos2;
1102 : }
1103 :
1104 : ACE_INLINE
1105 0 : bool Qos_Helper::changeable(
1106 : const DDS::EntityFactoryQosPolicy& /* qos1 */,
1107 : const DDS::EntityFactoryQosPolicy& /* qos2 */)
1108 : {
1109 0 : return true;
1110 : }
1111 :
1112 : ACE_INLINE
1113 0 : bool Qos_Helper::changeable(
1114 : const DDS::WriterDataLifecycleQosPolicy& /* qos1 */,
1115 : const DDS::WriterDataLifecycleQosPolicy& /* qos2 */)
1116 : {
1117 0 : return true;
1118 : }
1119 :
1120 : ACE_INLINE
1121 0 : bool Qos_Helper::changeable(
1122 : const DDS::ReaderDataLifecycleQosPolicy& /* qos1 */,
1123 : const DDS::ReaderDataLifecycleQosPolicy& /* qos2 */)
1124 : {
1125 0 : return true;
1126 : }
1127 :
1128 : ACE_INLINE
1129 0 : bool Qos_Helper::changeable(const DDS::DomainParticipantQos& qos1,
1130 : const DDS::DomainParticipantQos& qos2)
1131 : {
1132 : return
1133 0 : changeable(qos1.user_data, qos2.user_data)
1134 0 : && changeable(qos1.entity_factory, qos2.entity_factory);
1135 : }
1136 :
1137 : ACE_INLINE
1138 0 : bool Qos_Helper::changeable(const DDS::TopicQos& qos1,
1139 : const DDS::TopicQos& qos2)
1140 : {
1141 : return
1142 0 : changeable(qos1.topic_data, qos2.topic_data)
1143 0 : && changeable(qos1.durability, qos2.durability)
1144 : #ifndef OPENDDS_NO_PERSISTENCE_PROFILE
1145 0 : && changeable(qos1.durability_service, qos2.durability_service)
1146 : #endif
1147 0 : && changeable(qos1.deadline, qos2.deadline)
1148 0 : && changeable(qos1.latency_budget, qos2.latency_budget)
1149 0 : && changeable(qos1.liveliness, qos2.liveliness)
1150 0 : && changeable(qos1.reliability, qos2.reliability)
1151 0 : && changeable(qos1.destination_order, qos2.destination_order)
1152 0 : && changeable(qos1.history, qos2.history)
1153 0 : && changeable(qos1.resource_limits, qos2.resource_limits)
1154 0 : && changeable(qos1.transport_priority, qos2.transport_priority)
1155 0 : && changeable(qos1.lifespan, qos2.lifespan)
1156 0 : && changeable(qos1.ownership, qos2.ownership)
1157 0 : && changeable(qos1.representation, qos2.representation);
1158 : }
1159 :
1160 : ACE_INLINE
1161 0 : bool Qos_Helper::changeable(const DDS::DataWriterQos& qos1,
1162 : const DDS::DataWriterQos& qos2)
1163 : {
1164 : return
1165 0 : changeable(qos1.durability, qos2.durability)
1166 : #ifndef OPENDDS_NO_PERSISTENCE_PROFILE
1167 0 : && changeable(qos1.durability_service, qos2.durability_service)
1168 : #endif
1169 0 : && changeable(qos1.deadline, qos2.deadline)
1170 0 : && changeable(qos1.latency_budget, qos2.latency_budget)
1171 0 : && changeable(qos1.liveliness, qos2.liveliness)
1172 0 : && changeable(qos1.reliability, qos2.reliability)
1173 0 : && changeable(qos1.destination_order, qos2.destination_order)
1174 0 : && changeable(qos1.history, qos2.history)
1175 0 : && changeable(qos1.resource_limits, qos2.resource_limits)
1176 0 : && changeable(qos1.transport_priority, qos2.transport_priority)
1177 0 : && changeable(qos1.lifespan, qos2.lifespan)
1178 0 : && changeable(qos1.user_data, qos2.user_data)
1179 0 : && changeable(qos1.ownership, qos2.ownership)
1180 : #ifndef OPENDDS_NO_OWNERSHIP_KIND_EXCLUSIVE
1181 0 : && changeable(qos1.ownership_strength, qos2.ownership_strength)
1182 : #endif
1183 0 : && changeable(qos1.writer_data_lifecycle, qos2.writer_data_lifecycle)
1184 0 : && changeable(qos1.representation, qos2.representation);
1185 : }
1186 :
1187 : ACE_INLINE
1188 0 : bool Qos_Helper::changeable(const DDS::PublisherQos& qos1,
1189 : const DDS::PublisherQos& qos2)
1190 : {
1191 : return
1192 0 : changeable(qos1.presentation, qos2.presentation)
1193 0 : && changeable(qos1.partition, qos2.partition)
1194 0 : && changeable(qos1.group_data, qos2.group_data)
1195 0 : && changeable(qos1.entity_factory, qos2.entity_factory);
1196 : }
1197 :
1198 : ACE_INLINE
1199 0 : bool Qos_Helper::changeable(const DDS::DataReaderQos& qos1,
1200 : const DDS::DataReaderQos& qos2)
1201 : {
1202 : return
1203 0 : changeable(qos1.durability, qos2.durability)
1204 0 : && changeable(qos1.deadline, qos2.deadline)
1205 0 : && changeable(qos1.latency_budget, qos2.latency_budget)
1206 0 : && changeable(qos1.liveliness, qos2.liveliness)
1207 0 : && changeable(qos1.reliability, qos2.reliability)
1208 0 : && changeable(qos1.destination_order, qos2.destination_order)
1209 0 : && changeable(qos1.history, qos2.history)
1210 0 : && changeable(qos1.resource_limits, qos2.resource_limits)
1211 0 : && changeable(qos1.user_data, qos2.user_data)
1212 0 : && changeable(qos1.time_based_filter, qos2.time_based_filter)
1213 0 : && changeable(qos1.reader_data_lifecycle, qos2.reader_data_lifecycle)
1214 0 : && changeable(qos1.ownership, qos2.ownership)
1215 0 : && changeable(qos1.representation, qos2.representation);
1216 : }
1217 :
1218 : ACE_INLINE
1219 0 : bool Qos_Helper::changeable(const DDS::SubscriberQos& qos1,
1220 : const DDS::SubscriberQos& qos2)
1221 : {
1222 : return
1223 0 : changeable(qos1.presentation, qos2.presentation)
1224 0 : && changeable(qos1.partition, qos2.partition)
1225 0 : && changeable(qos1.group_data, qos2.group_data)
1226 0 : && changeable(qos1.entity_factory, qos2.entity_factory);
1227 : }
1228 :
1229 : ACE_INLINE
1230 0 : bool Qos_Helper::changeable(const DDS::DomainParticipantFactoryQos& qos1,
1231 : const DDS::DomainParticipantFactoryQos& qos2)
1232 : {
1233 0 : return changeable(qos1.entity_factory, qos2.entity_factory);
1234 : }
1235 :
1236 : ACE_INLINE
1237 0 : bool Qos_Helper::changeable(
1238 : const DDS::DataRepresentationQosPolicy& qos1,
1239 : const DDS::DataRepresentationQosPolicy& qos2)
1240 : {
1241 0 : return qos1 == qos2;
1242 : }
1243 :
1244 : ACE_INLINE
1245 0 : bool Qos_Helper::copy_from_topic_qos(DDS::DataReaderQos& a_datareader_qos,
1246 : const DDS::TopicQos& a_topic_qos)
1247 : {
1248 0 : if (!Qos_Helper::valid(a_topic_qos) || !Qos_Helper::consistent(a_topic_qos)) {
1249 0 : return false;
1250 : }
1251 : // the caller can get the default before calling this
1252 : // method if it wants to.
1253 0 : a_datareader_qos.durability = a_topic_qos.durability;
1254 0 : a_datareader_qos.deadline = a_topic_qos.deadline;
1255 0 : a_datareader_qos.latency_budget = a_topic_qos.latency_budget;
1256 0 : a_datareader_qos.liveliness = a_topic_qos.liveliness;
1257 0 : a_datareader_qos.reliability = a_topic_qos.reliability;
1258 0 : a_datareader_qos.destination_order = a_topic_qos.destination_order;
1259 0 : a_datareader_qos.history = a_topic_qos.history;
1260 0 : a_datareader_qos.resource_limits = a_topic_qos.resource_limits;
1261 0 : a_datareader_qos.ownership = a_topic_qos.ownership;
1262 0 : a_datareader_qos.representation = a_topic_qos.representation;
1263 0 : return true;
1264 : }
1265 :
1266 : ACE_INLINE
1267 0 : bool Qos_Helper::copy_from_topic_qos(DDS::DataWriterQos& a_datawriter_qos,
1268 : const DDS::TopicQos& a_topic_qos)
1269 : {
1270 0 : if (!Qos_Helper::valid(a_topic_qos) || !Qos_Helper::consistent(a_topic_qos)) {
1271 0 : return false;
1272 : }
1273 : // Some members in the DataWriterQos are not contained
1274 : // in the TopicQos. The caller needs initialize them.
1275 0 : a_datawriter_qos.durability = a_topic_qos.durability;
1276 : #ifndef OPENDDS_NO_PERSISTENCE_PROFILE
1277 0 : a_datawriter_qos.durability_service = a_topic_qos.durability_service;
1278 : #endif
1279 0 : a_datawriter_qos.deadline = a_topic_qos.deadline;
1280 0 : a_datawriter_qos.latency_budget = a_topic_qos.latency_budget;
1281 0 : a_datawriter_qos.liveliness = a_topic_qos.liveliness;
1282 0 : a_datawriter_qos.reliability = a_topic_qos.reliability;
1283 0 : a_datawriter_qos.destination_order = a_topic_qos.destination_order;
1284 0 : a_datawriter_qos.history = a_topic_qos.history;
1285 0 : a_datawriter_qos.resource_limits = a_topic_qos.resource_limits;
1286 0 : a_datawriter_qos.transport_priority = a_topic_qos.transport_priority;
1287 0 : a_datawriter_qos.lifespan = a_topic_qos.lifespan;
1288 0 : a_datawriter_qos.ownership = a_topic_qos.ownership;
1289 0 : a_datawriter_qos.representation = a_topic_qos.representation;
1290 0 : return true;
1291 : }
1292 :
1293 : } // namespace DCPS
1294 : } // namespace OpenDDS
1295 :
1296 : OPENDDS_END_VERSIONED_NAMESPACE_DECL
|