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