OpenDDS  Snapshot(2023/04/07-19:43)
Public Member Functions | List of all members
QOS_PubSub_T< XML_QOS_TYPE, DDS_QOS_TYPE > Class Template Reference

#include <QOS_PubSub_T.h>

Public Member Functions

 QOS_PubSub_T ()
 
 ~QOS_PubSub_T ()
 
void read_qos (DDS_QOS_TYPE &, const XML_QOS_TYPE)
 

Detailed Description

template<typename XML_QOS_TYPE, typename DDS_QOS_TYPE>
class QOS_PubSub_T< XML_QOS_TYPE, DDS_QOS_TYPE >

Author
Marcel Smit (msmit.nosp@m.@rem.nosp@m.edy.n.nosp@m.l)

This template contains the parsing of all QOS XML setting which the Publisher and the Subscriber have in common.

The DDS_QOS_TYPE template attribute can either contain an DDS::PublisherQos or an DDS::SubscriberQos. These are the IDL representatives.

The XML_QOS_TYPE can either contain an ::dds::publisherQos or an ::dds::subscriberQos. These are the XML representatives.

Definition at line 22 of file QOS_PubSub_T.h.

Constructor & Destructor Documentation

◆ QOS_PubSub_T()

template<typename XML_QOS_TYPE , typename DDS_QOS_TYPE >
OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL QOS_PubSub_T< XML_QOS_TYPE, DDS_QOS_TYPE >::QOS_PubSub_T ( )

Definition at line 9 of file QOS_PubSub_T.cpp.

10 {
11 }

◆ ~QOS_PubSub_T()

template<typename XML_QOS_TYPE , typename DDS_QOS_TYPE >
QOS_PubSub_T< XML_QOS_TYPE, DDS_QOS_TYPE >::~QOS_PubSub_T ( )

Definition at line 14 of file QOS_PubSub_T.cpp.

15 {
16 }

Member Function Documentation

◆ read_qos()

template<typename XML_QOS_TYPE , typename DDS_QOS_TYPE >
void QOS_PubSub_T< XML_QOS_TYPE, DDS_QOS_TYPE >::read_qos ( DDS_QOS_TYPE &  dds_qos,
const XML_QOS_TYPE  xml_qos 
)

Definition at line 20 of file QOS_PubSub_T.cpp.

References ACE_DEBUG, ACE_ERROR, ACE_TEXT(), ACE_TEXT_ALWAYS_CHAR, OpenDDS::DCPS::DCPS_debug_level, DDS::GROUP_PRESENTATION_QOS, DDS::INSTANCE_PRESENTATION_QOS, LM_ERROR, LM_TRACE, OPENDDS_END_VERSIONED_NAMESPACE_DECL, FACE::string_dup(), and DDS::TOPIC_PRESENTATION_QOS.

Referenced by PublisherQos_Handler::get_publisher_qos(), and SubscriberQos_Handler::get_subscriber_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:
53  ACE_ERROR((LM_ERROR,
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  {
62  ACE_DEBUG((LM_TRACE,
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  {
75  ACE_DEBUG((LM_TRACE,
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  {
88  ACE_DEBUG((LM_TRACE,
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  {
110  ACE_DEBUG((LM_TRACE,
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  {
128  ACE_DEBUG((LM_TRACE,
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 }
#define ACE_DEBUG(X)
#define ACE_ERROR(X)
#define ACE_TEXT_ALWAYS_CHAR(STRING)
Char * string_dup(const Char *str)
ACE_CDR::ULong ULong
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")

The documentation for this class was generated from the following files: