QOS_DwDrTp_Base_T.cpp

Go to the documentation of this file.
00001 
00002 #include "dds/DdsDcpsInfrastructureC.h"
00003 #include "QOS_Common.h"
00004 #include "dds/DCPS/debug.h"
00005 
00006 template <typename XML_QOS_TYPE, typename DDS_QOS_TYPE>
00007 QOS_DwDrTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::QOS_DwDrTp_Base_T (void)
00008 {
00009 }
00010 
00011 template <typename XML_QOS_TYPE, typename DDS_QOS_TYPE>
00012 QOS_DwDrTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::~QOS_DwDrTp_Base_T (void)
00013 {
00014 }
00015 
00016 template <typename XML_QOS_TYPE, typename DDS_QOS_TYPE>
00017 void
00018 QOS_DwDrTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos (DDS_QOS_TYPE& dds_qos, const XML_QOS_TYPE xml_qos)
00019 {
00020   if (xml_qos->durability_p ())
00021     {
00022       if (xml_qos->durability().kind_p ())
00023         {
00024           QosCommon::get_durability_kind (xml_qos->durability().kind (),
00025                                           dds_qos.durability.kind);
00026 
00027           if (OpenDDS::DCPS::DCPS_debug_level > 9)
00028             {
00029               ACE_DEBUG ((LM_TRACE,
00030                 ACE_TEXT ("QOS_DwDrTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
00031                 ACE_TEXT ("set durability to <%d>\n"),
00032                 dds_qos.durability.kind));
00033             }
00034 
00035         }
00036     }
00037   if (xml_qos->deadline_p ())
00038     {
00039       const std::string nsec = xml_qos->deadline().period ().nanosec ();
00040       const std::string sec = xml_qos->deadline().period ().sec ();
00041 
00042       QosCommon::get_duration (dds_qos.deadline.period,
00043                                 sec.c_str (),
00044                                 nsec.c_str ());
00045 
00046       if (OpenDDS::DCPS::DCPS_debug_level > 9)
00047         {
00048           ACE_DEBUG ((LM_TRACE,
00049             ACE_TEXT ("QOS_DwDrTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
00050             ACE_TEXT ("Set deadline to <%d:%u>\n"),
00051             dds_qos.deadline.period.sec,
00052             dds_qos.deadline.period.nanosec));
00053         }
00054     }
00055   if (xml_qos->latency_budget_p ())
00056     {
00057       const std::string nsec = xml_qos->latency_budget().duration ().nanosec ();
00058       const std::string sec = xml_qos->latency_budget().duration ().sec ();
00059 
00060       QosCommon::get_duration (dds_qos.latency_budget.duration,
00061                                 sec.c_str (),
00062                                 nsec.c_str ());
00063 
00064       if (OpenDDS::DCPS::DCPS_debug_level > 9)
00065         {
00066           ACE_DEBUG ((LM_TRACE,
00067             ACE_TEXT ("QOS_DwDrTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
00068             ACE_TEXT ("Set latency_budget to <%d:%u>\n"),
00069             dds_qos.latency_budget.duration.sec, \
00070             dds_qos.latency_budget.duration.nanosec));
00071         }
00072     }
00073   if (xml_qos->liveliness_p ())
00074     {
00075       if (xml_qos->liveliness ().kind_p ())
00076         {
00077           QosCommon::get_liveliness_kind (xml_qos->liveliness ().kind (),
00078                                           dds_qos.liveliness.kind);
00079 
00080           if (OpenDDS::DCPS::DCPS_debug_level > 9)
00081             {
00082               ACE_DEBUG ((LM_TRACE,
00083                 ACE_TEXT ("QOS_DwDrTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
00084                 ACE_TEXT ("Set liveliness_kind to <%d>\n"),
00085                 dds_qos.liveliness.kind));
00086             }
00087         }
00088       if (xml_qos->liveliness ().lease_duration_p ())
00089         {
00090           const std::string nsec = xml_qos->liveliness ().lease_duration ().nanosec ();
00091           const std::string sec = xml_qos->liveliness ().lease_duration ().sec ();
00092 
00093           QosCommon::get_duration (dds_qos.liveliness.lease_duration,
00094                                     sec.c_str (),
00095                                     nsec.c_str ());
00096 
00097           if (OpenDDS::DCPS::DCPS_debug_level > 9)
00098             {
00099               ACE_DEBUG ((LM_TRACE,
00100                 ACE_TEXT ("QOS_DwDrTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
00101                 ACE_TEXT ("Set liveliness lease_duration to <%d:%u>\n"),
00102                 dds_qos.liveliness.lease_duration.sec,
00103                 dds_qos.liveliness.lease_duration.nanosec));
00104             }
00105         }
00106     }
00107   if (xml_qos->reliability_p ())
00108     {
00109       if (xml_qos->reliability ().kind_p ())
00110         {
00111           QosCommon::get_realiability_kind (xml_qos->reliability ().kind (),
00112                                             dds_qos.reliability.kind);
00113 
00114           if (OpenDDS::DCPS::DCPS_debug_level > 9)
00115             {
00116               ACE_DEBUG ((LM_TRACE,
00117                 ACE_TEXT ("QOS_DwDrTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
00118                 ACE_TEXT ("Set reliability_kind to <%d>\n"),
00119                 dds_qos.reliability.kind));
00120             }
00121         }
00122       if (xml_qos->reliability ().max_blocking_time_p ())
00123         {
00124           const std::string nsec = xml_qos->reliability().max_blocking_time ().nanosec ();
00125           const std::string sec = xml_qos->reliability().max_blocking_time ().sec ();
00126 
00127           QosCommon::get_duration (dds_qos.reliability.max_blocking_time,
00128                                     sec.c_str (),
00129                                     nsec.c_str ());
00130 
00131           if (OpenDDS::DCPS::DCPS_debug_level > 9)
00132             {
00133               ACE_DEBUG ((LM_TRACE,
00134                 ACE_TEXT ("QOS_DwDrTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
00135                 ACE_TEXT ("Set reliability max_blocking_time to <%d:%u>\n"),
00136                 dds_qos.reliability.max_blocking_time.sec,
00137                 dds_qos.reliability.max_blocking_time.nanosec));
00138             }
00139         }
00140     }
00141   if (xml_qos->destination_order_p ())
00142     {
00143       QosCommon::get_destination_order_kind (xml_qos->destination_order ().kind (),
00144                                              dds_qos.destination_order.kind);
00145 
00146       if (OpenDDS::DCPS::DCPS_debug_level > 9)
00147         {
00148           ACE_DEBUG ((LM_TRACE,
00149             ACE_TEXT ("QOS_DwDrTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
00150             ACE_TEXT ("Set destination_order to <%d>\n"),
00151             dds_qos.destination_order.kind));
00152         }
00153     }
00154   if (xml_qos->history_p ())
00155     {
00156       if (xml_qos->history ().kind_p ())
00157         {
00158           QosCommon::get_history_kind (xml_qos->history ().kind (),
00159                                        dds_qos.history.kind);
00160 
00161           if (OpenDDS::DCPS::DCPS_debug_level > 9)
00162             {
00163               ACE_DEBUG ((LM_TRACE,
00164                 ACE_TEXT ("QOS_DwDrTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
00165                 ACE_TEXT ("Set history to <%d>\n"),
00166                 dds_qos.history.kind));
00167             }
00168         }
00169       if (xml_qos->history ().depth_p ())
00170         {
00171           dds_qos.history.depth = static_cast<CORBA::Long>(xml_qos->history().depth());
00172 
00173           if (OpenDDS::DCPS::DCPS_debug_level > 9)
00174             {
00175               ACE_DEBUG ((LM_TRACE,
00176                 ACE_TEXT ("QOS_DwDrTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
00177                 ACE_TEXT ("Set history depth to <%u>\n"),
00178                 dds_qos.history.depth));
00179             }
00180         }
00181     }
00182   if (xml_qos->resource_limits_p ())
00183     {
00184       if (xml_qos->resource_limits ().max_samples_p ())
00185         {
00186           const std::string max_samples = xml_qos->resource_limits ().max_samples ();
00187 
00188           dds_qos.resource_limits.max_samples =
00189             QosCommon::get_qos_long (max_samples.c_str ());
00190 
00191           if (OpenDDS::DCPS::DCPS_debug_level > 9)
00192             {
00193               ACE_DEBUG ((LM_TRACE,
00194                 ACE_TEXT ("QOS_DwDrTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
00195                 ACE_TEXT ("Set Resource Limits max_samples to <%d>\n"),
00196                 dds_qos.resource_limits.max_samples));
00197             }
00198         }
00199       if (xml_qos->resource_limits ().max_instances_p ())
00200         {
00201           const std::string max_instances = xml_qos->resource_limits ().max_instances ();
00202 
00203           dds_qos.resource_limits.max_instances =
00204             QosCommon::get_qos_long (max_instances.c_str ());
00205 
00206           if (OpenDDS::DCPS::DCPS_debug_level > 9)
00207             {
00208               ACE_DEBUG ((LM_TRACE,
00209                 ACE_TEXT ("QOS_DwDrTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
00210                 ACE_TEXT ("Set Resource Limits max_instances to <%d>\n"),
00211                 dds_qos.resource_limits.max_instances));
00212             }
00213         }
00214       if (xml_qos->resource_limits ().max_samples_per_instance_p ())
00215         {
00216           const std::string max_samples_per_instance =
00217             xml_qos->resource_limits ().max_samples_per_instance ();
00218 
00219           dds_qos.resource_limits.max_samples_per_instance =
00220             QosCommon::get_qos_long (max_samples_per_instance.c_str ());
00221 
00222           if (OpenDDS::DCPS::DCPS_debug_level > 9)
00223             {
00224               ACE_DEBUG ((LM_TRACE,
00225                 ACE_TEXT ("QOS_DwDrTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
00226                 ACE_TEXT ("Set Resource Limits max_samples_per_instance to <%d>\n"),
00227                 dds_qos.resource_limits.max_samples_per_instance));
00228             }
00229         }
00230     }
00231   if (xml_qos->ownership_p ())
00232     {
00233       QosCommon::get_ownership_kind (xml_qos->ownership ().kind (),
00234                                      dds_qos.ownership.kind);
00235 
00236       if (OpenDDS::DCPS::DCPS_debug_level > 9)
00237         {
00238           ACE_DEBUG ((LM_TRACE,
00239             ACE_TEXT ("QOS_DwDrTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
00240             ACE_TEXT ("Set ownership to <%d>\n"),
00241             dds_qos.ownership.kind));
00242         }
00243     }
00244 }

Generated on Fri Feb 12 20:05:25 2016 for OpenDDS by  doxygen 1.4.7