OpenDDS  Snapshot(2023/04/07-19:43)
Static Public Member Functions | List of all members
QosCommon Class Reference

#include <QOS_Common.h>

Static Public Member Functions

static void get_duration (::DDS::Duration_t &duration, const ACE_TCHAR *sec, const ACE_TCHAR *nsec)
 
::CORBA::Long get_qos_long (const ACE_TCHAR *value)
 
static void get_durability_kind (const ::dds::durabilityKind kind, ::DDS::DurabilityQosPolicyKind &dds_kind)
 
static void get_history_kind (const ::dds::historyKind kind, ::DDS::HistoryQosPolicyKind &dds_kind)
 
static void get_liveliness_kind (const ::dds::livelinessKind kind, ::DDS::LivelinessQosPolicyKind &dds_kind)
 
static void get_realiability_kind (const dds::reliabilityKind kind, ::DDS::ReliabilityQosPolicyKind &dds_kind)
 
static void get_destination_order_kind (const ::dds::destinationOrderKind kind, ::DDS::DestinationOrderQosPolicyKind &dds_kind)
 
static void get_ownership_kind (::dds::ownershipKind kind, ::DDS::OwnershipQosPolicyKind &dds_kind)
 
static void get_type_consistency_kind (::dds::typeConsistencyKind kind, ::DDS::TypeConsistencyEnforcementQosPolicyKind_t &dds_kind)
 
static void get_data_presentation_id_kind (::dds::dataRepresentationIdKind kind, ::DDS::DataRepresentationId_t &dds_kind)
 

Detailed Description

Author
Marcel Smit (msmit.nosp@m.@rem.nosp@m.edy.n.nosp@m.l)

Converting most common QOS XML settings to IDL QOS.

Definition at line 22 of file QOS_Common.h.

Member Function Documentation

◆ get_data_presentation_id_kind()

void QosCommon::get_data_presentation_id_kind ( ::dds::dataRepresentationIdKind  kind,
::DDS::DataRepresentationId_t dds_kind 
)
static

Operations which convert QOS XML kinds to QOS IDL kinds.

Definition at line 203 of file QOS_Common.cpp.

References ACE_ERROR, ACE_TEXT(), LM_ERROR, OPENDDS_END_VERSIONED_NAMESPACE_DECL, OpenDDS::DCPS::UNALIGNED_CDR_DATA_REPRESENTATION, DDS::XCDR2_DATA_REPRESENTATION, DDS::XCDR_DATA_REPRESENTATION, and DDS::XML_DATA_REPRESENTATION.

Referenced by QOS_DwDrTp_Base_T< XML_QOS_TYPE, DDS_QOS_TYPE >::read_qos().

205 {
206  switch (kind.integral())
207  {
208  case ::dds::dataRepresentationIdKind::XCDR_DATA_REPRESENTATION_l:
210  break;
211  case ::dds::dataRepresentationIdKind::XML_DATA_REPRESENTATION_l:
213  break;
214  case ::dds::dataRepresentationIdKind::XCDR2_DATA_REPRESENTATION_l:
216  break;
217  case ::dds::dataRepresentationIdKind::UNALIGNED_CDR_DATA_REPRESENTATION_l:
219  break;
220  default:
221  ACE_ERROR((LM_ERROR,
222  ACE_TEXT("(%P|%t) ERROR: QosCommon::get_data_presentation_id_kind - ")
223  ACE_TEXT("Unknown data presentation kind found <%d>; returning XCDR2_DATA_REPRESENTATION\n"),
224  kind.integral()));
226  break;
227  }
228 }
#define ACE_ERROR(X)
const DataRepresentationId_t XCDR2_DATA_REPRESENTATION
const DataRepresentationId_t XCDR_DATA_REPRESENTATION
ACE_TEXT("TCP_Factory")
const DataRepresentationId_t XML_DATA_REPRESENTATION
const DDS::DataRepresentationId_t UNALIGNED_CDR_DATA_REPRESENTATION

◆ get_destination_order_kind()

void QosCommon::get_destination_order_kind ( const ::dds::destinationOrderKind  kind,
::DDS::DestinationOrderQosPolicyKind dds_kind 
)
static

Operations which convert QOS XML kinds to QOS IDL kinds.

Definition at line 137 of file QOS_Common.cpp.

References ACE_ERROR, ACE_TEXT(), DDS::BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS, DDS::BY_SOURCE_TIMESTAMP_DESTINATIONORDER_QOS, and LM_ERROR.

Referenced by QOS_DwDrTp_Base_T< XML_QOS_TYPE, DDS_QOS_TYPE >::read_qos().

139 {
140  switch (kind.integral())
141  {
142  case ::dds::destinationOrderKind::BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS_l:
144  break;
145  case ::dds::destinationOrderKind::BY_SOURCE_TIMESTAMP_DESTINATIONORDER_QOS_l:
147  break;
148  default:
149  ACE_ERROR((LM_ERROR,
150  ACE_TEXT("(%P|%t) ERROR: QosCommon::get_destination_order_kind - ")
151  ACE_TEXT("Unknown destination order kind found <%d>; returning BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS\n"),
152  kind.integral()));
154  break;
155  }
156 }
#define ACE_ERROR(X)
ACE_TEXT("TCP_Factory")

◆ get_durability_kind()

OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL void QosCommon::get_durability_kind ( const ::dds::durabilityKind  kind,
::DDS::DurabilityQosPolicyKind dds_kind 
)
static

Operations which convert QOS XML kinds to QOS IDL kinds.

Definition at line 6 of file QOS_Common.cpp.

References ACE_ERROR, ACE_TEXT(), LM_ERROR, DDS::PERSISTENT_DURABILITY_QOS, DDS::TRANSIENT_DURABILITY_QOS, DDS::TRANSIENT_LOCAL_DURABILITY_QOS, and DDS::VOLATILE_DURABILITY_QOS.

Referenced by QOS_DwDrTp_Base_T< XML_QOS_TYPE, DDS_QOS_TYPE >::read_qos().

8 {
9  switch (kind.integral())
10  {
11  case ::dds::durabilityKind::VOLATILE_DURABILITY_QOS_l:
13  break;
14  case ::dds::durabilityKind::TRANSIENT_LOCAL_DURABILITY_QOS_l:
16  break;
17  case ::dds::durabilityKind::TRANSIENT_DURABILITY_QOS_l:
19  break;
20  case ::dds::durabilityKind::PERSISTENT_DURABILITY_QOS_l:
22  break;
23  default:
24  ACE_ERROR((LM_ERROR,
25  ACE_TEXT("(%P|%t) ERROR: QosCommon::get_durability_kind - ")
26  ACE_TEXT("Unknown durability kind found <%d>; returning VOLATILE_DURABILITY_QOS\n"),
27  kind.integral()));
29  break;
30  }
31 }
#define ACE_ERROR(X)
ACE_TEXT("TCP_Factory")

◆ get_duration()

void QosCommon::get_duration ( ::DDS::Duration_t duration,
const ACE_TCHAR sec,
const ACE_TCHAR nsec 
)
static

get_duration

The QOS XML seconds and nano seconds tags may contain text (DURATION_INFINITY, DURATION_INFINITY_SEC, DURATION_INFINITY_NSEC). These values need to be converted to a numeric value.

Definition at line 56 of file QOS_Common.cpp.

References ACE_TEXT(), ACE_OS::atoi(), DDS::Duration_t::nanosec, DDS::Duration_t::sec, and ACE_OS::strcmp().

Referenced by QOS_DataReader_T< XML_QOS_TYPE, DDS_QOS_TYPE >::read_qos(), QOS_DwDrTp_Base_T< XML_QOS_TYPE, DDS_QOS_TYPE >::read_qos(), and QOS_DwTp_Base_T< XML_QOS_TYPE, DDS_QOS_TYPE >::read_qos().

57 {
58  if (sec != 0) {
59  if (ACE_OS::strcmp(sec, ACE_TEXT("DURATION_INFINITY")) == 0 ||
60  ACE_OS::strcmp(sec, ACE_TEXT("DURATION_INFINITE_SEC")) == 0) {
61  duration.sec = 0x7fffffff;
62  } else {
63  duration.sec = ACE_OS::atoi(sec);
64  }
65  }
66 
67  if (nsec != 0) {
68  if (ACE_OS::strcmp(nsec, ACE_TEXT("DURATION_INFINITY")) == 0 ||
69  ACE_OS::strcmp(nsec, ACE_TEXT("DURATION_INFINITE_NSEC")) == 0) {
70  duration.nanosec = 0x7fffffff;
71  } else {
72  duration.nanosec = ACE_OS::atoi(nsec);
73  }
74  }
75 }
unsigned long nanosec
Definition: DdsDcpsCore.idl:69
int strcmp(const char *s, const char *t)
ACE_TEXT("TCP_Factory")
int atoi(const char *s)

◆ get_history_kind()

void QosCommon::get_history_kind ( const ::dds::historyKind  kind,
::DDS::HistoryQosPolicyKind dds_kind 
)
static

Operations which convert QOS XML kinds to QOS IDL kinds.

Definition at line 34 of file QOS_Common.cpp.

References ACE_ERROR, ACE_TEXT(), DDS::KEEP_ALL_HISTORY_QOS, DDS::KEEP_LAST_HISTORY_QOS, and LM_ERROR.

Referenced by QOS_DwDrTp_Base_T< XML_QOS_TYPE, DDS_QOS_TYPE >::read_qos(), and QOS_DwTp_Base_T< XML_QOS_TYPE, DDS_QOS_TYPE >::read_qos().

36 {
37  switch (kind.integral())
38  {
39  case ::dds::historyKind::KEEP_ALL_HISTORY_QOS_l:
40  dds_kind = ::DDS::KEEP_ALL_HISTORY_QOS;
41  break;
42  case ::dds::historyKind::KEEP_LAST_HISTORY_QOS_l:
44  break;
45  default:
46  ACE_ERROR((LM_ERROR,
47  ACE_TEXT("(%P|%t) ERROR: QosCommon::get_history_kind - ")
48  ACE_TEXT("Unknown history kind found <%d>; returning KEEP_ALL_HISTORY_QOS\n"),
49  kind.integral()));
50  dds_kind = ::DDS::KEEP_ALL_HISTORY_QOS;
51  break;
52  }
53 }
#define ACE_ERROR(X)
ACE_TEXT("TCP_Factory")

◆ get_liveliness_kind()

void QosCommon::get_liveliness_kind ( const ::dds::livelinessKind  kind,
::DDS::LivelinessQosPolicyKind dds_kind 
)
static

Operations which convert QOS XML kinds to QOS IDL kinds.

Definition at line 90 of file QOS_Common.cpp.

References ACE_ERROR, ACE_TEXT(), DDS::AUTOMATIC_LIVELINESS_QOS, LM_ERROR, DDS::MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, and DDS::MANUAL_BY_TOPIC_LIVELINESS_QOS.

Referenced by QOS_DwDrTp_Base_T< XML_QOS_TYPE, DDS_QOS_TYPE >::read_qos().

92 {
93  switch (kind.integral())
94  {
95  case ::dds::livelinessKind::AUTOMATIC_LIVELINESS_QOS_l:
97  break;
98  case ::dds::livelinessKind::MANUAL_BY_PARTICIPANT_LIVELINESS_QOS_l:
100  break;
101  case ::dds::livelinessKind::MANUAL_BY_TOPIC_LIVELINESS_QOS_l:
103  break;
104  default:
105  ACE_ERROR((LM_ERROR,
106  ACE_TEXT("(%P|%t) ERROR: QosCommon::get_liveliness_kind - ")
107  ACE_TEXT("Unknown liveliness kind found <%d>; returning AUTOMATIC_LIVELINESS_QOS\n"),
108  kind.integral()));
110  break;
111  }
112 }
#define ACE_ERROR(X)
ACE_TEXT("TCP_Factory")

◆ get_ownership_kind()

void QosCommon::get_ownership_kind ( ::dds::ownershipKind  kind,
::DDS::OwnershipQosPolicyKind dds_kind 
)
static

Operations which convert QOS XML kinds to QOS IDL kinds.

Definition at line 159 of file QOS_Common.cpp.

References ACE_ERROR, ACE_TEXT(), DDS::EXCLUSIVE_OWNERSHIP_QOS, LM_ERROR, and DDS::SHARED_OWNERSHIP_QOS.

Referenced by QOS_DwDrTp_Base_T< XML_QOS_TYPE, DDS_QOS_TYPE >::read_qos().

161 {
162  switch (kind.integral())
163  {
164  case ::dds::ownershipKind::SHARED_OWNERSHIP_QOS_l:
165  dds_kind = ::DDS::SHARED_OWNERSHIP_QOS;
166  break;
167  case ::dds::ownershipKind::EXCLUSIVE_OWNERSHIP_QOS_l:
169  break;
170  default:
171  ACE_ERROR((LM_ERROR,
172  ACE_TEXT("(%P|%t) ERROR: QosCommon::get_ownership_kind - ")
173  ACE_TEXT("Unknown ownership kind found <%d>; returning SHARED_OWNERSHIP_QOS\n"),
174  kind.integral()));
175  dds_kind = ::DDS::SHARED_OWNERSHIP_QOS;
176  break;
177  }
178 }
#define ACE_ERROR(X)
ACE_TEXT("TCP_Factory")

◆ get_qos_long()

CORBA::Long QosCommon::get_qos_long ( const ACE_TCHAR value)
static

get_qos_long

The QOS XML integer tags may contain text (LENGTH_UNLIMITED). This value need to be converted to a numeric value.

Definition at line 78 of file QOS_Common.cpp.

References ACE_TEXT(), ACE_OS::atoi(), and ACE_OS::strcmp().

Referenced by QOS_DwDrTp_Base_T< XML_QOS_TYPE, DDS_QOS_TYPE >::read_qos(), and QOS_DwTp_Base_T< XML_QOS_TYPE, DDS_QOS_TYPE >::read_qos().

79 {
80  if (value == 0) {
81  return 0;
82  } else if (ACE_OS::strcmp(value, ACE_TEXT("LENGTH_UNLIMITED")) == 0) {
83  return -1;
84  } else {
85  return ACE_OS::atoi(value);
86  }
87 }
const LogLevel::Value value
Definition: debug.cpp:61
int strcmp(const char *s, const char *t)
ACE_TEXT("TCP_Factory")
int atoi(const char *s)

◆ get_realiability_kind()

void QosCommon::get_realiability_kind ( const dds::reliabilityKind  kind,
::DDS::ReliabilityQosPolicyKind dds_kind 
)
static

Operations which convert QOS XML kinds to QOS IDL kinds.

Definition at line 115 of file QOS_Common.cpp.

References ACE_ERROR, ACE_TEXT(), DDS::BEST_EFFORT_RELIABILITY_QOS, LM_ERROR, and DDS::RELIABLE_RELIABILITY_QOS.

Referenced by QOS_DwDrTp_Base_T< XML_QOS_TYPE, DDS_QOS_TYPE >::read_qos().

117 {
118  switch (kind.integral())
119  {
120  case ::dds::reliabilityKind::BEST_EFFORT_RELIABILITY_QOS_l:
122  break;
123  case ::dds::reliabilityKind::RELIABLE_RELIABILITY_QOS_l:
125  break;
126  default:
127  ACE_ERROR((LM_ERROR,
128  ACE_TEXT("(%P|%t) ERROR: QosCommon::get_liveliness_kind - ")
129  ACE_TEXT("Unknown reliability kind found <%d>; returning BEST_EFFORT_RELIABILITY_QOS\n"),
130  kind.integral()));
132  break;
133  }
134 }
#define ACE_ERROR(X)
ACE_TEXT("TCP_Factory")

◆ get_type_consistency_kind()

void QosCommon::get_type_consistency_kind ( ::dds::typeConsistencyKind  kind,
::DDS::TypeConsistencyEnforcementQosPolicyKind_t dds_kind 
)
static

Operations which convert QOS XML kinds to QOS IDL kinds.

Definition at line 181 of file QOS_Common.cpp.

References ACE_ERROR, ACE_TEXT(), DDS::ALLOW_TYPE_COERCION, DDS::DISALLOW_TYPE_COERCION, and LM_ERROR.

Referenced by QOS_DataReader_T< XML_QOS_TYPE, DDS_QOS_TYPE >::read_qos().

183 {
184  switch (kind.integral())
185  {
186  case ::dds::typeConsistencyKind::DISALLOW_TYPE_COERCION_l:
188  break;
189  case ::dds::typeConsistencyKind::ALLOW_TYPE_COERCION_l:
190  dds_kind = ::DDS::ALLOW_TYPE_COERCION;
191  break;
192  default:
193  ACE_ERROR((LM_ERROR,
194  ACE_TEXT("(%P|%t) ERROR: QosCommon::get_type_consistency_kind - ")
195  ACE_TEXT("Unknown type consistency kind found <%d>; returning DISALLOW_TYPE_COERCION\n"),
196  kind.integral()));
198  break;
199  }
200 }
#define ACE_ERROR(X)
const TypeConsistencyEnforcementQosPolicyKind_t DISALLOW_TYPE_COERCION
const TypeConsistencyEnforcementQosPolicyKind_t ALLOW_TYPE_COERCION
ACE_TEXT("TCP_Factory")

The documentation for this class was generated from the following files: