QosCommon Class Reference

#include <QOS_Common.h>

List of all members.

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)


Detailed Description

Author:
Marcel Smit (msmit@remedy.nl)
Converting most common QOS XML settings to IDL QOS.

Definition at line 20 of file QOS_Common.h.


Member Function Documentation

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 139 of file QOS_Common.cpp.

References DDS::BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS, and DDS::BY_SOURCE_TIMESTAMP_DESTINATIONORDER_QOS.

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

00141 {
00142   switch (kind.integral ())
00143     {
00144     case ::dds::destinationOrderKind::BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS_l:
00145       dds_kind = ::DDS::BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS;
00146       break;
00147     case ::dds::destinationOrderKind::BY_SOURCE_TIMESTAMP_DESTINATIONORDER_QOS_l:
00148       dds_kind = ::DDS::BY_SOURCE_TIMESTAMP_DESTINATIONORDER_QOS;
00149       break;
00150     default:
00151       ACE_ERROR ((LM_DEBUG,
00152         ACE_TEXT ("QosCommon::get_destination_order_kind - ")
00153         ACE_TEXT ("Unknown destination order kind found <%d>; returning BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS\n"),
00154         kind.integral ()));
00155       dds_kind = ::DDS::BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS;
00156       break;
00157     }
00158 }

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 5 of file QOS_Common.cpp.

References 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().

00007 {
00008   switch (kind.integral ())
00009     {
00010     case ::dds::durabilityKind::VOLATILE_DURABILITY_QOS_l:
00011       dds_kind = ::DDS::VOLATILE_DURABILITY_QOS;
00012       break;
00013     case ::dds::durabilityKind::TRANSIENT_LOCAL_DURABILITY_QOS_l:
00014       dds_kind = ::DDS::TRANSIENT_LOCAL_DURABILITY_QOS;
00015       break;
00016     case ::dds::durabilityKind::TRANSIENT_DURABILITY_QOS_l:
00017       dds_kind = ::DDS::TRANSIENT_DURABILITY_QOS;
00018       break;
00019     case ::dds::durabilityKind::PERSISTENT_DURABILITY_QOS_l:
00020       dds_kind = ::DDS::PERSISTENT_DURABILITY_QOS;
00021       break;
00022     default:
00023       ACE_ERROR ((LM_DEBUG,
00024         ACE_TEXT ("QosCommon::get_durability_kind - ")
00025         ACE_TEXT ("Unknown durability kind found <%d>; returning VOLATILE_DURABILITY_QOS\n"),
00026         kind.integral ()));
00027       dds_kind = ::DDS::VOLATILE_DURABILITY_QOS;
00028       break;
00029     }
00030 }

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 55 of file QOS_Common.cpp.

References DDS::Duration_t::nanosec, and DDS::Duration_t::sec.

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

00056 {
00057   if (ACE_OS::strcmp (sec, "DURATION_INFINITY") == 0 ||
00058       ACE_OS::strcmp (sec, "DURATION_INFINITE_SEC") == 0)
00059     {
00060       duration.sec = 0x7fffffff;
00061     }
00062   else
00063     {
00064       duration.sec = ACE_OS::atoi (sec);
00065     }
00066 
00067   if (ACE_OS::strcmp (nsec, "DURATION_INFINITY") == 0 ||
00068       ACE_OS::strcmp (nsec, "DURATION_INFINITE_NSEC") == 0)
00069     {
00070       duration.nanosec =  0x7fffffff;
00071     }
00072   else
00073     {
00074       duration.nanosec = ACE_OS::atoi (nsec);
00075     }
00076 }

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 33 of file QOS_Common.cpp.

References DDS::KEEP_ALL_HISTORY_QOS, and DDS::KEEP_LAST_HISTORY_QOS.

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

00035 {
00036   switch (kind.integral ())
00037     {
00038     case ::dds::historyKind::KEEP_ALL_HISTORY_QOS_l:
00039       dds_kind = ::DDS::KEEP_ALL_HISTORY_QOS;
00040       break;
00041     case ::dds::historyKind::KEEP_LAST_HISTORY_QOS_l:
00042       dds_kind = ::DDS::KEEP_LAST_HISTORY_QOS;
00043       break;
00044     default:
00045       ACE_ERROR ((LM_DEBUG,
00046         ACE_TEXT ("QosCommon::get_history_kind - ")
00047         ACE_TEXT ("Unknown history kind found <%d>; returning KEEP_ALL_HISTORY_QOS\n"),
00048         kind.integral ()));
00049       dds_kind = ::DDS::KEEP_ALL_HISTORY_QOS;
00050       break;
00051     }
00052 }

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 92 of file QOS_Common.cpp.

References DDS::AUTOMATIC_LIVELINESS_QOS, 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().

00094 {
00095   switch (kind.integral ())
00096     {
00097     case ::dds::livelinessKind::AUTOMATIC_LIVELINESS_QOS_l:
00098       dds_kind = ::DDS::AUTOMATIC_LIVELINESS_QOS;
00099       break;
00100     case ::dds::livelinessKind::MANUAL_BY_PARTICIPANT_LIVELINESS_QOS_l:
00101       dds_kind = ::DDS::MANUAL_BY_PARTICIPANT_LIVELINESS_QOS;
00102       break;
00103     case ::dds::livelinessKind::MANUAL_BY_TOPIC_LIVELINESS_QOS_l:
00104       dds_kind = ::DDS::MANUAL_BY_TOPIC_LIVELINESS_QOS;
00105       break;
00106     default:
00107       ACE_ERROR ((LM_DEBUG,
00108         ACE_TEXT ("QosCommon::get_liveliness_kind - ")
00109         ACE_TEXT ("Unknown liveliness kind found <%d>; returning AUTOMATIC_LIVELINESS_QOS\n"),
00110         kind.integral ()));
00111       dds_kind = ::DDS::AUTOMATIC_LIVELINESS_QOS;
00112       break;
00113     }
00114 }

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 161 of file QOS_Common.cpp.

References DDS::EXCLUSIVE_OWNERSHIP_QOS, and DDS::SHARED_OWNERSHIP_QOS.

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

00163 {
00164   switch (kind.integral ())
00165     {
00166     case ::dds::ownershipKind::SHARED_OWNERSHIP_QOS_l:
00167       dds_kind = ::DDS::SHARED_OWNERSHIP_QOS;
00168       break;
00169     case ::dds::ownershipKind::EXCLUSIVE_OWNERSHIP_QOS_l:
00170       dds_kind = ::DDS::EXCLUSIVE_OWNERSHIP_QOS;
00171       break;
00172     default:
00173       ACE_ERROR ((LM_DEBUG,
00174         ACE_TEXT ("QosCommon::get_ownership_kind - ")
00175         ACE_TEXT ("Unknown ownership kind found <%d>; returning SHARED_OWNERSHIP_QOS\n"),
00176         kind.integral ()));
00177       dds_kind = ::DDS::SHARED_OWNERSHIP_QOS;
00178       break;
00179     }
00180 }

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 79 of file QOS_Common.cpp.

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

00080 {
00081   if (ACE_OS::strcmp (value, "LENGTH_UNLIMITED") == 0)
00082     {
00083       return -1;
00084     }
00085   else
00086     {
00087       return atoi (value);
00088     }
00089 }

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

Operations which convert QOS XML kinds to QOS IDL kinds.

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


The documentation for this class was generated from the following files:
Generated on Fri Feb 12 20:05:57 2016 for OpenDDS by  doxygen 1.4.7