QOS_DwTp_Base_T.cpp

Go to the documentation of this file.
00001 
00002 #include "dds/DdsDcpsInfrastructureC.h"
00003 #include "QOS_Common.h"
00004 
00005 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL
00006 
00007 template <typename XML_QOS_TYPE, typename DDS_QOS_TYPE>
00008 QOS_DwTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::QOS_DwTp_Base_T (void)
00009 {
00010 }
00011 
00012 template <typename XML_QOS_TYPE, typename DDS_QOS_TYPE>
00013 QOS_DwTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::~QOS_DwTp_Base_T (void)
00014 {
00015 }
00016 
00017 template <typename XML_QOS_TYPE, typename DDS_QOS_TYPE>
00018 void
00019 QOS_DwTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos (DDS_QOS_TYPE& dds_qos, const XML_QOS_TYPE xml_qos)
00020 {
00021   DwDrTpBase::read_qos (dds_qos, xml_qos);
00022 
00023   if (xml_qos->durability_service_p ())
00024     {
00025       if (xml_qos->durability_service ().service_cleanup_delay_p ())
00026         {
00027           const std::string nsec = xml_qos->durability_service ().service_cleanup_delay ().nanosec ();
00028           const std::string sec = xml_qos->durability_service ().service_cleanup_delay ().sec ();
00029 
00030           QosCommon::get_duration (dds_qos.durability_service.service_cleanup_delay,
00031                                    sec.c_str (),
00032                                    nsec.c_str ());
00033           if (OpenDDS::DCPS::DCPS_debug_level > 9)
00034             {
00035               ACE_DEBUG ((LM_TRACE,
00036                 ACE_TEXT ("QOS_DwTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
00037                 ACE_TEXT ("Set durability Service service_cleanup_delay to <%d:%u>\n"),
00038                 dds_qos.durability_service.service_cleanup_delay.sec,
00039                 dds_qos.durability_service.service_cleanup_delay.nanosec));
00040             }
00041         }
00042       if (xml_qos->durability_service ().history_kind_p ())
00043         {
00044           QosCommon::get_history_kind (xml_qos->durability_service ().history_kind (),
00045                                        dds_qos.durability_service.history_kind);
00046 
00047           if (OpenDDS::DCPS::DCPS_debug_level > 9)
00048             {
00049               ACE_DEBUG ((LM_TRACE,
00050                 ACE_TEXT ("QOS_DwTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
00051                 ACE_TEXT ("Set durability Service history_kind to <%d>\n"),
00052                 dds_qos.durability_service.history_kind));
00053             }
00054 
00055         }
00056       if (xml_qos->durability_service ().history_depth_p ())
00057         {
00058           dds_qos.durability_service.history_depth =
00059             static_cast<CORBA::Long>(xml_qos->durability_service().history_depth());
00060 
00061           if (OpenDDS::DCPS::DCPS_debug_level > 9)
00062             {
00063               ACE_DEBUG ((LM_TRACE,
00064                 ACE_TEXT ("QOS_DwTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
00065                 ACE_TEXT ("Set durability Service history_depth to <%u>\n"),
00066                 dds_qos.durability_service.history_depth));
00067             }
00068         }
00069       if (xml_qos->durability_service ().max_samples_p ())
00070         {
00071           const std::string max_samples = xml_qos->durability_service ().max_samples ();
00072 
00073           dds_qos.durability_service.max_samples =
00074             QosCommon::get_qos_long (max_samples.c_str ());
00075 
00076           if (OpenDDS::DCPS::DCPS_debug_level > 9)
00077             {
00078               ACE_DEBUG ((LM_TRACE,
00079                 ACE_TEXT ("QOS_DwTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
00080                 ACE_TEXT ("Set durability service max_samples to <%d>\n"),
00081                 dds_qos.durability_service.max_samples));
00082             }
00083         }
00084       if (xml_qos->durability_service ().max_instances_p ())
00085         {
00086           const std::string max_instances = xml_qos->durability_service ().max_instances ();
00087 
00088           dds_qos.durability_service.max_instances =
00089             QosCommon::get_qos_long (max_instances.c_str ());
00090 
00091           if (OpenDDS::DCPS::DCPS_debug_level > 9)
00092             {
00093               ACE_DEBUG ((LM_TRACE,
00094                 ACE_TEXT ("QOS_DwTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
00095                 ACE_TEXT ("Set durability service max_instances to <%d>\n"),
00096                 dds_qos.durability_service.max_instances));
00097             }
00098         }
00099       if (xml_qos->durability_service ().max_samples_per_instance_p ())
00100         {
00101           const std::string max_samples_per_instance =
00102             xml_qos->durability_service ().max_samples_per_instance ();
00103 
00104           dds_qos.durability_service.max_samples_per_instance =
00105             QosCommon::get_qos_long (max_samples_per_instance.c_str ());
00106 
00107           if (OpenDDS::DCPS::DCPS_debug_level > 9)
00108             {
00109               ACE_DEBUG ((LM_TRACE,
00110                 ACE_TEXT ("QOS_DwTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
00111                 ACE_TEXT ("Set durability service max_samples_per_instance to <%u>\n"),
00112                 dds_qos.durability_service.max_samples_per_instance));
00113             }
00114         }
00115     }
00116   if (xml_qos->transport_priority_p ())
00117     {
00118       dds_qos.transport_priority.value =
00119         static_cast<CORBA::Long>(xml_qos->transport_priority().value());
00120 
00121       if (OpenDDS::DCPS::DCPS_debug_level > 9)
00122         {
00123           ACE_DEBUG ((LM_TRACE,
00124             ACE_TEXT ("QOS_DwTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
00125             ACE_TEXT ("Set transport_priority to <%u>\n"),
00126             dds_qos.transport_priority.value));
00127         }
00128     }
00129   if (xml_qos->lifespan_p ())
00130     {
00131       if (xml_qos->lifespan ().duration_p ())
00132         {
00133           const std::string nsec = xml_qos->lifespan ().duration ().nanosec ();
00134           const std::string sec = xml_qos->lifespan ().duration ().sec ();
00135 
00136           QosCommon::get_duration (dds_qos.lifespan.duration,
00137                                    sec.c_str (),
00138                                    nsec.c_str ());
00139           if (OpenDDS::DCPS::DCPS_debug_level > 9)
00140             {
00141               ACE_DEBUG ((LM_TRACE,
00142                 ACE_TEXT ("QOS_DwTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
00143                 ACE_TEXT ("Set Lifespan duration to <%d:%u>\n"),
00144                 dds_qos.lifespan.duration.sec, dds_qos.lifespan.duration.nanosec));
00145             }
00146         }
00147     }
00148 }
00149 
00150 OPENDDS_END_VERSIONED_NAMESPACE_DECL
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 10 Aug 2018 for OpenDDS by  doxygen 1.6.1