OpenDDS  Snapshot(2023/04/28-20:55)
Qos_Helper.inl
Go to the documentation of this file.
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 
14 
15 namespace OpenDDS {
16 namespace DCPS {
17 
18 #ifndef OPENDDS_SAFETY_PROFILE
21  const DDS::UserDataQosPolicy& qos2)
22 {
23  return qos1.value == qos2.value;
24 }
25 
28  const DDS::TopicDataQosPolicy& qos2)
29 {
30  return qos1.value == qos2.value;
31 }
32 
35  const DDS::GroupDataQosPolicy& qos2)
36 {
37  return qos1.value == qos2.value;
38 }
39 
43 {
44  return qos1.value == qos2.value;
45 }
46 
49  const DDS::LifespanQosPolicy& qos2)
50 {
51  return qos1.duration == qos2.duration;
52 }
53 
55 bool
57  const DDS::DurabilityQosPolicy& qos2)
58 {
59  return qos1.kind == qos2.kind;
60 }
61 
63 bool
66 {
67  return
69  && qos1.history_kind == qos2.history_kind
70  && qos1.history_depth == qos2.history_depth
71  && qos1.max_samples == qos2.max_samples
72  && qos1.max_instances == qos2.max_instances
74 }
75 
78  const DDS::PresentationQosPolicy& qos2)
79 {
80  return
81  qos1.access_scope == qos2.access_scope
82  && qos1.coherent_access == qos2.coherent_access
83  && qos1.ordered_access == qos2.ordered_access;
84 }
85 
88  const DDS::DeadlineQosPolicy& qos2)
89 {
90  return qos1.period == qos2.period;
91 }
92 
95  const DDS::LatencyBudgetQosPolicy& qos2)
96 {
97  return qos1.duration == qos2.duration;
98 }
99 
102  const DDS::OwnershipQosPolicy& qos2)
103 {
104  return qos1.kind == qos2.kind;
105 }
106 
110 {
111  return qos1.value == qos2.value;
112 }
113 
116  const DDS::LivelinessQosPolicy& qos2)
117 {
118  return
119  qos1.kind == qos2.kind
120  && qos1.lease_duration == qos2.lease_duration;
121 }
122 
125  const DDS::TimeBasedFilterQosPolicy& qos2)
126 {
127  return qos1.minimum_separation == qos2.minimum_separation;
128 }
129 
132  const DDS::PartitionQosPolicy& qos2)
133 {
134  const CORBA::ULong len = qos1.name.length();
135 
136  if (len == qos2.name.length()) {
137  for (CORBA::ULong i = 0; i < len; ++i) {
138  if (0 != ACE_OS::strcmp(qos1.name[i], qos2.name[i])) {
139  return false;
140  }
141  }
142 
143  return true;
144  }
145 
146  return false;
147 }
148 
151  const DDS::ReliabilityQosPolicy& qos2)
152 {
153  return
154  qos1.kind == qos2.kind
155  && qos1.max_blocking_time == qos2.max_blocking_time;
156 }
157 
160  const DDS::DestinationOrderQosPolicy& qos2)
161 {
162  return qos1.kind == qos2.kind;
163 }
164 
167  const DDS::HistoryQosPolicy& qos2)
168 {
169  return
170  qos1.kind == qos2.kind
171  && qos1.depth == qos2.depth;
172 }
173 
176  const DDS::ResourceLimitsQosPolicy& qos2)
177 {
178  return
179  qos1.max_samples == qos2.max_samples
180  && qos1.max_instances == qos2.max_instances
182 }
183 
186  const DDS::EntityFactoryQosPolicy& qos2)
187 {
188  // Marked_Default_Qos for DomainParticipant uses a value that's not 0 or 1
189  return std::memcmp(&qos1.autoenable_created_entities,
191  sizeof qos2.autoenable_created_entities) == 0;
192 }
193 
197 {
198  return
200 }
201 
205 {
206  return
209 }
210 
211 template <typename T>
214 {
215  if (seq1.length() != seq2.length()) {
216  return false;
217  }
218 
219  for (unsigned int i = 0; i < seq1.length(); ++i) {
220  if (seq1[i].name != seq2[i].name || seq1[i].value != seq2[i].value || seq1[i].propagate != seq2[i].propagate) {
221  return false;
222  }
223  }
224  return true;
225 }
226 
229  const DDS::PropertyQosPolicy& qos2)
230 {
231  return qos1.value == qos2.value && qos1.binary_value == qos2.binary_value;
232 }
233 
236  const DDS::DomainParticipantQos& qos2)
237 {
238  return
239  qos1.user_data == qos2.user_data
240  && qos1.entity_factory == qos2.entity_factory
241  && qos1.property == qos2.property;
242 }
243 
245 bool operator==(const DDS::TopicQos& qos1,
246  const DDS::TopicQos& qos2)
247 {
248  return
249  qos1.topic_data == qos2.topic_data
250  && qos1.durability == qos2.durability
251  && qos1.durability_service == qos2.durability_service
252  && qos1.deadline == qos2.deadline
253  && qos1.latency_budget == qos2.latency_budget
254  && qos1.liveliness == qos2.liveliness
255  && qos1.reliability == qos2.reliability
256  && qos1.destination_order == qos2.destination_order
257  && qos1.history == qos2.history
258  && qos1.resource_limits == qos2.resource_limits
259  && qos1.transport_priority == qos2.transport_priority
260  && qos1.lifespan == qos2.lifespan
261  && qos1.ownership == qos2.ownership
262  && qos1.representation == qos2.representation;
263 }
264 
267  const DDS::DataWriterQos& qos2)
268 {
269  return
270  qos1.durability == qos2.durability
271  && qos1.durability_service == qos2.durability_service
272  && qos1.deadline == qos2.deadline
273  && qos1.latency_budget == qos2.latency_budget
274  && qos1.liveliness == qos2.liveliness
275  && qos1.reliability == qos2.reliability
276  && qos1.destination_order == qos2.destination_order
277  && qos1.history == qos2.history
278  && qos1.resource_limits == qos2.resource_limits
279  && qos1.transport_priority == qos2.transport_priority
280  && qos1.lifespan == qos2.lifespan
281  && qos1.user_data == qos2.user_data
282  && qos1.ownership == qos2.ownership
283 #ifndef OPENDDS_NO_OWNERSHIP_KIND_EXCLUSIVE
284  && qos1.ownership_strength == qos2.ownership_strength
285 #endif
287  && qos1.representation == qos2.representation;
288 }
289 
291 bool operator==(const DDS::PublisherQos& qos1,
292  const DDS::PublisherQos& qos2)
293 {
294  return
295  qos1.presentation == qos2.presentation
296  && qos1.partition == qos2.partition
297  && qos1.group_data == qos2.group_data
298  && qos1.entity_factory == qos2.entity_factory;
299 }
300 
303  const DDS::DataReaderQos& qos2)
304 {
305  return
306  qos1.durability == qos2.durability
307  && qos1.deadline == qos2.deadline
308  && qos1.latency_budget == qos2.latency_budget
309  && qos1.liveliness == qos2.liveliness
310  && qos1.reliability == qos2.reliability
311  && qos1.destination_order == qos2.destination_order
312  && qos1.history == qos2.history
313  && qos1.resource_limits == qos2.resource_limits
314  && qos1.user_data == qos2.user_data
315  && qos1.time_based_filter == qos2.time_based_filter
317  && qos1.representation == qos2.representation;
318 }
319 
322  const DDS::SubscriberQos& qos2)
323 {
324  return
325  qos1.presentation == qos2.presentation
326  && qos1.partition == qos2.partition
327  && qos1.group_data == qos2.group_data
328  && qos1.entity_factory == qos2.entity_factory;
329 }
330 
334 {
335  return qos1.entity_factory == qos2.entity_factory;
336 }
337 
341 {
342  const CORBA::ULong count = qos1.value.length();
343  const CORBA::ULong count2 = qos2.value.length();
344  if (count != count2) {
345  return false;
346  }
347  for (CORBA::ULong i = 0; i < count; ++i) {
348  if (qos1.value[i] != qos2.value[i]) {
349  return false;
350  }
351  }
352  return true;
353 }
354 
358 {
359  return qos1.kind == qos2.kind
365 }
366 
369  const DDS::UserDataQosPolicy& qos2)
370 {
371  return !(qos1 == qos2);
372 }
373 
376  const DDS::TopicDataQosPolicy& qos2)
377 {
378  return !(qos1 == qos2);
379 }
380 
383  const DDS::GroupDataQosPolicy& qos2)
384 {
385  return !(qos1 == qos2);
386 }
387 
391 {
392  return !(qos1 == qos2);
393 }
394 
397  const DDS::LifespanQosPolicy& qos2)
398 {
399  return !(qos1 == qos2);
400 }
401 
403 bool
405  const DDS::DurabilityQosPolicy& qos2)
406 {
407  return !(qos1 == qos2);
408 }
409 
411 bool
414 {
415  return !(qos1 == qos2);
416 }
417 
420  const DDS::PresentationQosPolicy& qos2)
421 {
422  return !(qos1 == qos2);
423 }
424 
427  const DDS::DeadlineQosPolicy& qos2)
428 {
429  return !(qos1 == qos2);
430 }
431 
434  const DDS::LatencyBudgetQosPolicy& qos2)
435 {
436  return !(qos1 == qos2);
437 }
438 
441  const DDS::OwnershipQosPolicy& qos2)
442 {
443  return !(qos1 == qos2);
444 }
445 
449 {
450  return !(qos1 == qos2);
451 }
452 
455  const DDS::LivelinessQosPolicy& qos2)
456 {
457  return !(qos1 == qos2);
458 }
459 
462  const DDS::TimeBasedFilterQosPolicy& qos2)
463 {
464  return !(qos1 == qos2);
465 }
466 
469  const DDS::PartitionQosPolicy& qos2)
470 {
471  return !(qos1 == qos2);
472 }
473 
476  const DDS::ReliabilityQosPolicy& qos2)
477 {
478  return !(qos1 == qos2);
479 }
480 
483  const DDS::DestinationOrderQosPolicy& qos2)
484 {
485  return !(qos1 == qos2);
486 }
487 
490  const DDS::HistoryQosPolicy& qos2)
491 {
492  return !(qos1 == qos2);
493 }
494 
497  const DDS::ResourceLimitsQosPolicy& qos2)
498 {
499  return !(qos1 == qos2);
500 }
501 
504  const DDS::EntityFactoryQosPolicy& qos2)
505 {
506  return !(qos1 == qos2);
507 }
508 
512 {
513  return !(qos1 == qos2);
514 }
515 
519 {
520  return !(qos1 == qos2);
521 }
522 
525  const DDS::PropertyQosPolicy& qos2)
526 {
527  return !(qos1 == qos2);
528 }
529 
532  const DDS::DomainParticipantQos& qos2)
533 {
534  return !(qos1 == qos2);
535 }
536 
538 bool operator!=(const DDS::TopicQos& qos1,
539  const DDS::TopicQos& qos2)
540 {
541  return !(qos1 == qos2);
542 }
543 
546  const DDS::DataWriterQos& qos2)
547 {
548  return !(qos1 == qos2);
549 }
550 
552 bool operator!=(const DDS::PublisherQos& qos1,
553  const DDS::PublisherQos& qos2)
554 {
555  return !(qos1 == qos2);
556 }
557 
560  const DDS::DataReaderQos& qos2)
561 {
562  return !(qos1 == qos2);
563 }
564 
567  const DDS::SubscriberQos& qos2)
568 {
569  return !(qos1 == qos2);
570 }
571 
575 {
576  return !(qos1 == qos2);
577 }
578 
582 {
583  return !(qos1 == qos2);
584 }
585 
589 {
590  return !(qos1 == qos2);
591 }
592 #endif
593 
595 bool
597  const DDS::ResourceLimitsQosPolicy& resource_limits,
598  const DDS::HistoryQosPolicy& history)
599 {
600  CORBA::Long const max_samples_per_instance =
601  resource_limits.max_samples_per_instance;
602  CORBA::Long const max_samples = resource_limits.max_samples;
603 
604  return
605  (max_samples_per_instance == DDS::LENGTH_UNLIMITED
606  || (max_samples_per_instance >= history.depth
607  && (max_samples == DDS::LENGTH_UNLIMITED
608  || max_samples >= max_samples_per_instance)));
609 }
610 
612 bool
614  const DDS::TimeBasedFilterQosPolicy& time_based_filter)
615 {
616  return time_based_filter.minimum_separation <= deadline.period;
617 }
618 
621 {
622  return true;
623 }
624 
627 {
628  // Leverage existing validation functions for related QoS
629  // policies.
630 
631 #ifndef OPENDDS_NO_PERSISTENCE_PROFILE
632  DDS::HistoryQosPolicy const ds_history = {
635  };
636 
637  DDS::ResourceLimitsQosPolicy const ds_resource_limits = {
641  };
642 
643  return
645  && consistent(ds_resource_limits, ds_history);
646 #else
647  ACE_UNUSED_ARG(qos);
648  return true;
649 #endif
650 }
651 
653 bool
655 {
656  // Leverage existing validation functions for related QoS
657  // policies.
658 
659 #ifndef OPENDDS_NO_PERSISTENCE_PROFILE
660  DDS::HistoryQosPolicy const ds_history = {
663  };
664 
665  DDS::ResourceLimitsQosPolicy const ds_resource_limits = {
669  };
670 
671  return
673  && consistent(ds_resource_limits, ds_history);
674 #else
675  ACE_UNUSED_ARG(qos);
676  return true;
677 #endif
678 }
679 
681 bool
683 {
684  return true;
685 }
686 
688 bool
690 {
691  return
694 }
695 
697 bool
699 {
700  return true;
701 }
702 
704 bool
706 {
707  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.
724 {
725  return true;
726 }
727 
730 {
731  return true;
732 }
733 
736 {
737  return true;
738 }
739 
740 // All values of TRANSPORT_PRIORITY.value are accepted.
743 {
744  return true;
745 }
746 
749 {
750  return valid_duration(qos.duration);
751 }
752 
754 bool
756 {
757  return
762 }
763 
766 {
767  return
771 }
772 
775 {
776  return valid_duration(qos.period);
777 }
778 
781 {
782  return true;
783 }
784 
787 {
788  return
790 #ifndef OPENDDS_NO_OWNERSHIP_KIND_EXCLUSIVE
792 #endif
793  ;
794 }
795 
796 #ifndef OPENDDS_NO_OWNERSHIP_KIND_EXCLUSIVE
799 {
800  return true;
801 }
802 #endif
803 
806 {
807  return
811 
813 }
814 
817 {
818  return true;
819 }
820 
822 bool
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  return true;
829 }
830 
833 {
834  return
837 }
838 
841 {
844 }
845 
847 bool
849 {
850  return
853  && (qos.depth == DDS::LENGTH_UNLIMITED
854  || qos.depth > 0);
855 }
856 
858 bool
860 {
861  return
863  || qos.max_samples > 0)
865  || qos.max_instances > 0)
867  || qos.max_samples_per_instance > 0);
868 }
869 
870 #ifndef OPENDDS_NO_PERSISTENCE_PROFILE
872 bool
874 {
875  // Leverage existing validation functions for related QoS
876  // policies.
877  DDS::HistoryQosPolicy const history = {
878  qos.history_kind,
879  qos.history_depth
880  };
881 
882  DDS::ResourceLimitsQosPolicy const resource_limits = {
883  qos.max_samples,
884  qos.max_instances,
886  };
887 
888  return
890  && valid(history)
891  && valid(resource_limits);
892 }
893 #endif
894 
897 {
898  // see Marked_Default_Qos::marked_default_DomainParticipantQos()
899  const void* const mem = &qos.autoenable_created_entities;
900  return *static_cast<const char*>(mem) != 3;
901 }
902 
905 {
906  return true;
907 }
908 
911 {
912  return true;
913 }
914 
917 {
918  return true;
919 }
920 
923 {
924  const CORBA::ULong count = qos.value.length();
925 
926  for (CORBA::ULong i = 0; i < count; ++i) {
927  const CORBA::Short value = qos.value[i];
928 
929  switch (value) {
934  break;
935 
936  default:
937  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  return false;
941  };
942  }
943 
944  return true;
945 }
946 
949  const DDS::UserDataQosPolicy& /* qos2 */)
950 {
951  return true;
952 }
953 
956  const DDS::TopicDataQosPolicy & /* qos2 */)
957 {
958  return true;
959 }
960 
963  const DDS::GroupDataQosPolicy& /* qos2 */)
964 {
965  return true;
966 }
967 
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  return qos1 == qos2;
979 }
980 
982 bool
984  const DDS::LifespanQosPolicy& /* qos2 */)
985 {
986  return true;
987 }
988 
991  const DDS::DurabilityQosPolicy& qos2)
992 {
993  return qos1 == qos2;
994 }
995 
996 #ifndef OPENDDS_NO_PERSISTENCE_PROFILE
998 bool
1000  const DDS::DurabilityServiceQosPolicy& qos2)
1001 {
1002  return qos1 == qos2;
1003 }
1004 #endif
1005 
1006 ACE_INLINE
1008  const DDS::PresentationQosPolicy& qos2)
1009 {
1010  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
1022  const DDS::DeadlineQosPolicy& /* qos2 */)
1023 {
1024  return true;
1025 }
1026 
1027 ACE_INLINE
1029  const DDS::LatencyBudgetQosPolicy& /* qos1 */,
1030  const DDS::LatencyBudgetQosPolicy& /* qos2 */)
1031 {
1032  return true;
1033 }
1034 
1035 ACE_INLINE
1037  const DDS::OwnershipQosPolicy& qos2)
1038 {
1039  return qos1 == qos2;
1040 }
1041 // ---------------------------------------------------------------
1042 
1043 #ifndef OPENDDS_NO_OWNERSHIP_KIND_EXCLUSIVE
1044 ACE_INLINE
1046  const DDS::OwnershipStrengthQosPolicy& /* qos1 */,
1047  const DDS::OwnershipStrengthQosPolicy& /* qos2 */)
1048 {
1049  return true;
1050 }
1051 #endif
1052 
1053 ACE_INLINE
1055  const DDS::LivelinessQosPolicy& qos2)
1056 {
1057  return qos1 == qos2;
1058 }
1059 
1060 ACE_INLINE
1062  const DDS::TimeBasedFilterQosPolicy& /* qos1 */,
1063  const DDS::TimeBasedFilterQosPolicy& /* qos2*/)
1064 {
1065  return true;
1066 }
1067 
1068 ACE_INLINE
1069 bool
1071  const DDS::PartitionQosPolicy& /* qos2 */)
1072 {
1073  return true;
1074 }
1075 
1076 ACE_INLINE
1078  const DDS::ReliabilityQosPolicy& qos2)
1079 {
1080  return qos1 == qos2;
1081 }
1082 
1083 ACE_INLINE
1085  const DDS::DestinationOrderQosPolicy& qos2)
1086 {
1087  return qos1 == qos2;
1088 }
1089 
1090 ACE_INLINE
1092  const DDS::HistoryQosPolicy& qos2)
1093 {
1094  return qos1 == qos2;
1095 }
1096 
1097 ACE_INLINE
1099  const DDS::ResourceLimitsQosPolicy& qos2)
1100 {
1101  return qos1 == qos2;
1102 }
1103 
1104 ACE_INLINE
1106  const DDS::EntityFactoryQosPolicy& /* qos1 */,
1107  const DDS::EntityFactoryQosPolicy& /* qos2 */)
1108 {
1109  return true;
1110 }
1111 
1112 ACE_INLINE
1114  const DDS::WriterDataLifecycleQosPolicy& /* qos1 */,
1115  const DDS::WriterDataLifecycleQosPolicy& /* qos2 */)
1116 {
1117  return true;
1118 }
1119 
1120 ACE_INLINE
1122  const DDS::ReaderDataLifecycleQosPolicy& /* qos1 */,
1123  const DDS::ReaderDataLifecycleQosPolicy& /* qos2 */)
1124 {
1125  return true;
1126 }
1127 
1128 ACE_INLINE
1130  const DDS::DomainParticipantQos& qos2)
1131 {
1132  return
1133  changeable(qos1.user_data, qos2.user_data)
1134  && changeable(qos1.entity_factory, qos2.entity_factory);
1135 }
1136 
1137 ACE_INLINE
1139  const DDS::TopicQos& qos2)
1140 {
1141  return
1142  changeable(qos1.topic_data, qos2.topic_data)
1143  && changeable(qos1.durability, qos2.durability)
1144 #ifndef OPENDDS_NO_PERSISTENCE_PROFILE
1146 #endif
1147  && changeable(qos1.deadline, qos2.deadline)
1149  && changeable(qos1.liveliness, qos2.liveliness)
1150  && changeable(qos1.reliability, qos2.reliability)
1152  && changeable(qos1.history, qos2.history)
1155  && changeable(qos1.lifespan, qos2.lifespan)
1156  && changeable(qos1.ownership, qos2.ownership)
1157  && changeable(qos1.representation, qos2.representation);
1158 }
1159 
1160 ACE_INLINE
1162  const DDS::DataWriterQos& qos2)
1163 {
1164  return
1165  changeable(qos1.durability, qos2.durability)
1166 #ifndef OPENDDS_NO_PERSISTENCE_PROFILE
1168 #endif
1169  && changeable(qos1.deadline, qos2.deadline)
1171  && changeable(qos1.liveliness, qos2.liveliness)
1172  && changeable(qos1.reliability, qos2.reliability)
1174  && changeable(qos1.history, qos2.history)
1177  && changeable(qos1.lifespan, qos2.lifespan)
1178  && changeable(qos1.user_data, qos2.user_data)
1179  && changeable(qos1.ownership, qos2.ownership)
1180 #ifndef OPENDDS_NO_OWNERSHIP_KIND_EXCLUSIVE
1182 #endif
1184  && changeable(qos1.representation, qos2.representation);
1185 }
1186 
1187 ACE_INLINE
1189  const DDS::PublisherQos& qos2)
1190 {
1191  return
1193  && changeable(qos1.partition, qos2.partition)
1194  && changeable(qos1.group_data, qos2.group_data)
1195  && changeable(qos1.entity_factory, qos2.entity_factory);
1196 }
1197 
1198 ACE_INLINE
1200  const DDS::DataReaderQos& qos2)
1201 {
1202  return
1203  changeable(qos1.durability, qos2.durability)
1204  && changeable(qos1.deadline, qos2.deadline)
1206  && changeable(qos1.liveliness, qos2.liveliness)
1207  && changeable(qos1.reliability, qos2.reliability)
1209  && changeable(qos1.history, qos2.history)
1211  && changeable(qos1.user_data, qos2.user_data)
1214  && changeable(qos1.ownership, qos2.ownership)
1215  && changeable(qos1.representation, qos2.representation);
1216 }
1217 
1218 ACE_INLINE
1220  const DDS::SubscriberQos& qos2)
1221 {
1222  return
1224  && changeable(qos1.partition, qos2.partition)
1225  && changeable(qos1.group_data, qos2.group_data)
1226  && changeable(qos1.entity_factory, qos2.entity_factory);
1227 }
1228 
1229 ACE_INLINE
1232 {
1233  return changeable(qos1.entity_factory, qos2.entity_factory);
1234 }
1235 
1236 ACE_INLINE
1240 {
1241  return qos1 == qos2;
1242 }
1243 
1244 ACE_INLINE
1246  const DDS::TopicQos& a_topic_qos)
1247 {
1248  if (!Qos_Helper::valid(a_topic_qos) || !Qos_Helper::consistent(a_topic_qos)) {
1249  return false;
1250  }
1251  // the caller can get the default before calling this
1252  // method if it wants to.
1253  a_datareader_qos.durability = a_topic_qos.durability;
1254  a_datareader_qos.deadline = a_topic_qos.deadline;
1255  a_datareader_qos.latency_budget = a_topic_qos.latency_budget;
1256  a_datareader_qos.liveliness = a_topic_qos.liveliness;
1257  a_datareader_qos.reliability = a_topic_qos.reliability;
1258  a_datareader_qos.destination_order = a_topic_qos.destination_order;
1259  a_datareader_qos.history = a_topic_qos.history;
1260  a_datareader_qos.resource_limits = a_topic_qos.resource_limits;
1261  a_datareader_qos.ownership = a_topic_qos.ownership;
1262  a_datareader_qos.representation = a_topic_qos.representation;
1263  return true;
1264 }
1265 
1266 ACE_INLINE
1268  const DDS::TopicQos& a_topic_qos)
1269 {
1270  if (!Qos_Helper::valid(a_topic_qos) || !Qos_Helper::consistent(a_topic_qos)) {
1271  return false;
1272  }
1273  // Some members in the DataWriterQos are not contained
1274  // in the TopicQos. The caller needs initialize them.
1275  a_datawriter_qos.durability = a_topic_qos.durability;
1276 #ifndef OPENDDS_NO_PERSISTENCE_PROFILE
1277  a_datawriter_qos.durability_service = a_topic_qos.durability_service;
1278 #endif
1279  a_datawriter_qos.deadline = a_topic_qos.deadline;
1280  a_datawriter_qos.latency_budget = a_topic_qos.latency_budget;
1281  a_datawriter_qos.liveliness = a_topic_qos.liveliness;
1282  a_datawriter_qos.reliability = a_topic_qos.reliability;
1283  a_datawriter_qos.destination_order = a_topic_qos.destination_order;
1284  a_datawriter_qos.history = a_topic_qos.history;
1285  a_datawriter_qos.resource_limits = a_topic_qos.resource_limits;
1286  a_datawriter_qos.transport_priority = a_topic_qos.transport_priority;
1287  a_datawriter_qos.lifespan = a_topic_qos.lifespan;
1288  a_datawriter_qos.ownership = a_topic_qos.ownership;
1289  a_datawriter_qos.representation = a_topic_qos.representation;
1290  return true;
1291 }
1292 
1293 } // namespace DCPS
1294 } // namespace OpenDDS
1295 
UserDataQosPolicy user_data
PartitionQosPolicy partition
HistoryQosPolicy history
ACE_CDR::Long Long
#define ACE_ERROR(X)
const LogLevel::Value value
Definition: debug.cpp:61
EntityFactoryQosPolicy entity_factory
LatencyBudgetQosPolicy latency_budget
ReliabilityQosPolicy reliability
GroupDataQosPolicy group_data
LifespanQosPolicy lifespan
OwnershipQosPolicy ownership
DurabilityQosPolicy durability
HistoryQosPolicyKind kind
ACE_INLINE OpenDDS_Dcps_Export bool non_negative_duration(const DDS::Duration_t &t)
TimeBasedFilterQosPolicy time_based_filter
TransportPriorityQosPolicy transport_priority
static bool changeable(const DDS::UserDataQosPolicy &qos1, const DDS::UserDataQosPolicy &qos2)
Definition: Qos_Helper.inl:948
PresentationQosPolicyAccessScopeKind access_scope
DataRepresentationQosPolicy representation
ACE_CDR::Short Short
OwnershipQosPolicy ownership
LivelinessQosPolicy liveliness
DeadlineQosPolicy deadline
OwnershipQosPolicyKind kind
DestinationOrderQosPolicy destination_order
EntityFactoryQosPolicy entity_factory
const DataRepresentationId_t XCDR_DATA_REPRESENTATION
DataRepresentationQosPolicy representation
EntityFactoryQosPolicy entity_factory
bool operator==(const DisjointSequence::OrderedRanges< T > &a, const DisjointSequence::OrderedRanges< T > &b)
ResourceLimitsQosPolicy resource_limits
EntityFactoryQosPolicy entity_factory
DestinationOrderQosPolicyKind kind
LatencyBudgetQosPolicy latency_budget
DestinationOrderQosPolicy destination_order
DurabilityServiceQosPolicy durability_service
PresentationQosPolicy presentation
const DataRepresentationId_t XCDR2_DATA_REPRESENTATION
ReliabilityQosPolicyKind kind
ACE_CDR::ULong ULong
DurabilityQosPolicyKind kind
DurabilityQosPolicy durability
OwnershipStrengthQosPolicy ownership_strength
DestinationOrderQosPolicy destination_order
DataRepresentationQosPolicy representation
ACE_INLINE OpenDDS_Dcps_Export bool valid_duration(DDS::Duration_t const &t)
DurabilityQosPolicy durability
ResourceLimitsQosPolicy resource_limits
TopicDataQosPolicy topic_data
const DataRepresentationId_t XML_DATA_REPRESENTATION
DeadlineQosPolicy deadline
ReliabilityQosPolicy reliability
const DDS::DataRepresentationId_t UNALIGNED_CDR_DATA_REPRESENTATION
int strcmp(const char *s, const char *t)
const char *const name
Definition: debug.cpp:60
static bool copy_from_topic_qos(DDS::DataReaderQos &a_datareader_qos, const DDS::TopicQos &a_topic_qos)
ReaderDataLifecycleQosPolicy reader_data_lifecycle
BinaryPropertySeq binary_value
ACE_TEXT("TCP_Factory")
local interface<%TYPE%> inout ::DDS::SampleInfoSeq in long max_samples
Definition: IDLTemplate.txt:72
HistoryQosPolicy history
OwnershipQosPolicy ownership
bool operator!=(const GUID_t &lhs, const GUID_t &rhs)
Definition: GuidUtils.h:125
TransportPriorityQosPolicy transport_priority
ReliabilityQosPolicy reliability
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
HistoryQosPolicy history
LifespanQosPolicy lifespan
WriterDataLifecycleQosPolicy writer_data_lifecycle
CORBA::ULong length() const
LivelinessQosPolicyKind kind
#define ACE_INLINE
const long LENGTH_UNLIMITED
LivelinessQosPolicy liveliness
TypeConsistencyEnforcementQosPolicyKind_t kind
DataRepresentationIdSeq value
UserDataQosPolicy user_data
UserDataQosPolicy user_data
DeadlineQosPolicy deadline
static bool valid(const DDS::UserDataQosPolicy &qos)
Definition: Qos_Helper.inl:723
GroupDataQosPolicy group_data
static bool consistent(const DDS::ResourceLimitsQosPolicy &resource_limits, const DDS::HistoryQosPolicy &history)
Definition: Qos_Helper.inl:596
LM_ERROR
PartitionQosPolicy partition
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28
HistoryQosPolicyKind history_kind
PresentationQosPolicy presentation
ResourceLimitsQosPolicy resource_limits
LivelinessQosPolicy liveliness
PropertyQosPolicy property
DurabilityServiceQosPolicy durability_service
LatencyBudgetQosPolicy latency_budget