OpenDDS  Snapshot(2023/04/28-20:55)
QOS_DwTp_Base_T.cpp
Go to the documentation of this file.
1 
2 #include "dds/DdsDcpsInfrastructureC.h"
3 #include "QOS_Common.h"
4 
6 
7 template <typename XML_QOS_TYPE, typename DDS_QOS_TYPE>
9 {
10 }
11 
12 template <typename XML_QOS_TYPE, typename DDS_QOS_TYPE>
14 {
15 }
16 
17 template <typename XML_QOS_TYPE, typename DDS_QOS_TYPE>
18 void
19 QOS_DwTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos(DDS_QOS_TYPE& dds_qos, const XML_QOS_TYPE xml_qos)
20 {
21  DwDrTpBase::read_qos(dds_qos, xml_qos);
22 
23  if (xml_qos->durability_service_p())
24  {
25  if (xml_qos->durability_service().service_cleanup_delay_p())
26  {
27  const ACE_TString sec(xml_qos->durability_service().service_cleanup_delay().sec().c_str());
28  const ACE_TString nsec(xml_qos->durability_service().service_cleanup_delay().nanosec().c_str());
29 
30  QosCommon::get_duration(dds_qos.durability_service.service_cleanup_delay,
31  sec.c_str(),
32  nsec.c_str());
34  {
36  ACE_TEXT("QOS_DwTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
37  ACE_TEXT("Set durability Service service_cleanup_delay to <%d:%u>\n"),
38  dds_qos.durability_service.service_cleanup_delay.sec,
39  dds_qos.durability_service.service_cleanup_delay.nanosec));
40  }
41  }
42  if (xml_qos->durability_service().history_kind_p())
43  {
44  QosCommon::get_history_kind(xml_qos->durability_service().history_kind(),
45  dds_qos.durability_service.history_kind);
46 
48  {
50  ACE_TEXT("QOS_DwTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
51  ACE_TEXT("Set durability Service history_kind to <%d>\n"),
52  dds_qos.durability_service.history_kind));
53  }
54 
55  }
56  if (xml_qos->durability_service().history_depth_p())
57  {
58  dds_qos.durability_service.history_depth =
59  static_cast<CORBA::Long>(xml_qos->durability_service().history_depth());
60 
62  {
64  ACE_TEXT("QOS_DwTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
65  ACE_TEXT("Set durability Service history_depth to <%u>\n"),
66  dds_qos.durability_service.history_depth));
67  }
68  }
69  if (xml_qos->durability_service().max_samples_p())
70  {
71  const ACE_TString max_samples(xml_qos->durability_service().max_samples().c_str());
72 
73  dds_qos.durability_service.max_samples =
75 
77  {
79  ACE_TEXT("QOS_DwTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
80  ACE_TEXT("Set durability service max_samples to <%d>\n"),
81  dds_qos.durability_service.max_samples));
82  }
83  }
84  if (xml_qos->durability_service().max_instances_p())
85  {
86  const ACE_TString max_instances(xml_qos->durability_service().max_instances().c_str());
87 
88  dds_qos.durability_service.max_instances =
89  QosCommon::get_qos_long(max_instances.c_str());
90 
92  {
94  ACE_TEXT("QOS_DwTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
95  ACE_TEXT("Set durability service max_instances to <%d>\n"),
96  dds_qos.durability_service.max_instances));
97  }
98  }
99  if (xml_qos->durability_service().max_samples_per_instance_p())
100  {
101  const ACE_TString max_samples_per_instance(xml_qos->durability_service().max_samples_per_instance().c_str());
102 
103  dds_qos.durability_service.max_samples_per_instance =
104  QosCommon::get_qos_long(max_samples_per_instance.c_str());
105 
107  {
109  ACE_TEXT("QOS_DwTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
110  ACE_TEXT("Set durability service max_samples_per_instance to <%u>\n"),
111  dds_qos.durability_service.max_samples_per_instance));
112  }
113  }
114  }
115  if (xml_qos->transport_priority_p())
116  {
117  dds_qos.transport_priority.value =
118  static_cast<CORBA::Long>(xml_qos->transport_priority().value());
119 
121  {
123  ACE_TEXT("QOS_DwTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
124  ACE_TEXT("Set transport_priority to <%u>\n"),
125  dds_qos.transport_priority.value));
126  }
127  }
128  if (xml_qos->lifespan_p())
129  {
130  if (xml_qos->lifespan().duration_p())
131  {
132  const ACE_TString sec(xml_qos->lifespan().duration().sec().c_str());
133  const ACE_TString nsec(xml_qos->lifespan().duration().nanosec().c_str());
134 
135  QosCommon::get_duration(dds_qos.lifespan.duration,
136  sec.c_str(),
137  nsec.c_str());
139  {
141  ACE_TEXT("QOS_DwTp_Base_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
142  ACE_TEXT("Set Lifespan duration to <%d:%u>\n"),
143  dds_qos.lifespan.duration.sec, dds_qos.lifespan.duration.nanosec));
144  }
145  }
146  }
147 }
148 
#define ACE_DEBUG(X)
ACE_CDR::Long Long
LM_TRACE
ACE_TEXT("TCP_Factory")
local interface<%TYPE%> inout ::DDS::SampleInfoSeq in long max_samples
Definition: IDLTemplate.txt:72
::CORBA::Long get_qos_long(const ACE_TCHAR *value)
Definition: QOS_Common.cpp:78
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
static void get_history_kind(const ::dds::historyKind kind, ::DDS::HistoryQosPolicyKind &dds_kind)
Definition: QOS_Common.cpp:34
static void get_duration(::DDS::Duration_t &duration, const ACE_TCHAR *sec, const ACE_TCHAR *nsec)
Definition: QOS_Common.cpp:56
void read_qos(DDS_QOS_TYPE &, const XML_QOS_TYPE)