OpenDDS  Snapshot(2023/04/28-20:55)
QOS_PubSub_T.cpp
Go to the documentation of this file.
1 
2 #include "dds/DdsDcpsInfrastructureC.h"
3 #include "QOS_Common.h"
4 #include "dds/DCPS/debug.h"
5 
7 
8 template <typename XML_QOS_TYPE, typename DDS_QOS_TYPE>
10 {
11 }
12 
13 template <typename XML_QOS_TYPE, typename DDS_QOS_TYPE>
15 {
16 }
17 
18 template <typename XML_QOS_TYPE, typename DDS_QOS_TYPE>
19 void
20 QOS_PubSub_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos(DDS_QOS_TYPE& dds_qos, const XML_QOS_TYPE xml_qos)
21 {
22 // if (xml_qos->group_data())
23 // {
24  // TODO: Have a good look at this.
25 
26 // const std::string value = *xml_qos->group_data()->value();
27 //
28 // ACE_DEBUG((LM_TRACE,
29 // ACE_TEXT("QOS_DataReader_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
30 // ACE_TEXT("Set group_data to <%C>\n"),
31 // value.c_str()));
32 //
33 // dds_qos.group_data.value =
34 // *xml_qos->group_data()->value();
35 // }
36 
37  if (xml_qos->presentation_p())
38  {
39  if (xml_qos->presentation().access_scope_p())
40  {
41  switch (xml_qos->presentation().access_scope().integral())
42  {
43  case ::dds::presentationAccessScopeKind::INSTANCE_PRESENTATION_QOS_l:
44  dds_qos.presentation.access_scope = ::DDS::INSTANCE_PRESENTATION_QOS;
45  break;
46  case ::dds::presentationAccessScopeKind::TOPIC_PRESENTATION_QOS_l:
47  dds_qos.presentation.access_scope = ::DDS::TOPIC_PRESENTATION_QOS;
48  break;
49  case ::dds::presentationAccessScopeKind::GROUP_PRESENTATION_QOS_l:
50  dds_qos.presentation.access_scope = ::DDS::GROUP_PRESENTATION_QOS;
51  break;
52  default:
54  ACE_TEXT("(%P|%t) ERROR: QOS_PubSub_T::read_qos - ")
55  ACE_TEXT("Unknown presentation access scope found <%d>; setting it to INSTANCE_PRESENTATION_QOS\n"),
56  xml_qos->presentation().access_scope().integral()));
57  dds_qos.presentation.access_scope = ::DDS::INSTANCE_PRESENTATION_QOS;
58  break;
59  }
61  {
63  ACE_TEXT("QOS_PubSub_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
64  ACE_TEXT("Set presentation access scope to <%d>\n"),
65  dds_qos.presentation.access_scope));
66  }
67  }
68  if (xml_qos->presentation().coherent_access_p())
69  {
70  dds_qos.presentation.coherent_access =
71  xml_qos->presentation().coherent_access();
72 
74  {
76  ACE_TEXT("QOS_PubSub_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
77  ACE_TEXT("Set presentation coherent_access to <%d>\n"),
78  dds_qos.presentation.coherent_access));
79  }
80  }
81  if (xml_qos->presentation().ordered_access_p())
82  {
83  dds_qos.presentation.ordered_access =
84  xml_qos->presentation().ordered_access();
85 
87  {
89  ACE_TEXT("QOS_PubSub_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
90  ACE_TEXT("Set presentation ordered_access to <%d>\n"),
91  dds_qos.presentation.ordered_access));
92  }
93  }
94  }
95 
96  if (xml_qos->partition_p())
97  {
98  if (xml_qos->partition().name_p())
99  {
100  dds_qos.partition.name.length(static_cast<CORBA::ULong>(xml_qos->partition().name().count_element()));
101  CORBA::ULong pos = 0;
102  for (::dds::stringSeq::element_const_iterator it = xml_qos->partition().name().begin_element();
103  it != xml_qos->partition().name().end_element();
104  ++it, ++pos)
105  {
106  dds_qos.partition.name[pos] = ::CORBA::string_dup(ACE_TEXT_ALWAYS_CHAR(it->get()->c_str()));
107 
109  {
111  ACE_TEXT("QOS_PubSub_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
112  ACE_TEXT("New name <%s> inserted in partition at position <%u>\n"),
113  dds_qos.partition.name[pos].in(), pos));
114  }
115  }
116  }
117  }
118 
119  if (xml_qos->entity_factory_p())
120  {
121  if (xml_qos->entity_factory().autoenable_created_entities_p())
122  {
123  dds_qos.entity_factory.autoenable_created_entities =
124  xml_qos->entity_factory().autoenable_created_entities();
125 
127  {
129  ACE_TEXT("QOS_PubSub_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
130  ACE_TEXT("Set entity_factory autoenable_created_entities to <%d>\n"),
131  dds_qos.entity_factory.autoenable_created_entities));
132  }
133  }
134  }
135 }
136 
#define ACE_DEBUG(X)
#define ACE_ERROR(X)
#define ACE_TEXT_ALWAYS_CHAR(STRING)
ACE_CDR::ULong ULong
LM_TRACE
void read_qos(DDS_QOS_TYPE &, const XML_QOS_TYPE)
ACE_TEXT("TCP_Factory")
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
Char * string_dup(const Char *str)
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
LM_ERROR