QOS_PubSub_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 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL
00007
00008 template <typename XML_QOS_TYPE, typename DDS_QOS_TYPE>
00009 QOS_PubSub_T<XML_QOS_TYPE, DDS_QOS_TYPE>::QOS_PubSub_T (void)
00010 {
00011 }
00012
00013 template <typename XML_QOS_TYPE, typename DDS_QOS_TYPE>
00014 QOS_PubSub_T<XML_QOS_TYPE, DDS_QOS_TYPE>::~QOS_PubSub_T (void)
00015 {
00016 }
00017
00018 template <typename XML_QOS_TYPE, typename DDS_QOS_TYPE>
00019 void
00020 QOS_PubSub_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos (DDS_QOS_TYPE& dds_qos, const XML_QOS_TYPE xml_qos)
00021 {
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 if (xml_qos->presentation_p ())
00038 {
00039 if (xml_qos->presentation ().access_scope_p ())
00040 {
00041 switch (xml_qos->presentation ().access_scope ().integral ())
00042 {
00043 case ::dds::presentationAccessScopeKind::INSTANCE_PRESENTATION_QOS_l:
00044 dds_qos.presentation.access_scope = ::DDS::INSTANCE_PRESENTATION_QOS;
00045 break;
00046 case ::dds::presentationAccessScopeKind::TOPIC_PRESENTATION_QOS_l:
00047 dds_qos.presentation.access_scope = ::DDS::TOPIC_PRESENTATION_QOS;
00048 break;
00049 case ::dds::presentationAccessScopeKind::GROUP_PRESENTATION_QOS_l:
00050 dds_qos.presentation.access_scope = ::DDS::GROUP_PRESENTATION_QOS;
00051 break;
00052 default:
00053 ACE_ERROR ((LM_DEBUG,
00054 ACE_TEXT ("QOS_PubSub_T::read_qos - ")
00055 ACE_TEXT ("Unknown presentation access scope found <%d>; setting it to INSTANCE_PRESENTATION_QOS\n"),
00056 xml_qos->presentation ().access_scope ().integral ()));
00057 dds_qos.presentation.access_scope = ::DDS::INSTANCE_PRESENTATION_QOS;
00058 break;
00059 }
00060 if (OpenDDS::DCPS::DCPS_debug_level > 9)
00061 {
00062 ACE_DEBUG ((LM_TRACE,
00063 ACE_TEXT ("QOS_PubSub_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
00064 ACE_TEXT ("Set presentation access scope to <%d>\n"),
00065 dds_qos.presentation.access_scope));
00066 }
00067 }
00068 if (xml_qos->presentation ().coherent_access_p ())
00069 {
00070 dds_qos.presentation.coherent_access =
00071 xml_qos->presentation ().coherent_access ();
00072
00073 if (OpenDDS::DCPS::DCPS_debug_level > 9)
00074 {
00075 ACE_DEBUG ((LM_TRACE,
00076 ACE_TEXT ("QOS_PubSub_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
00077 ACE_TEXT ("Set presentation coherent_access to <%d>\n"),
00078 dds_qos.presentation.coherent_access));
00079 }
00080 }
00081 if (xml_qos->presentation ().ordered_access_p ())
00082 {
00083 dds_qos.presentation.ordered_access =
00084 xml_qos->presentation ().ordered_access ();
00085
00086 if (OpenDDS::DCPS::DCPS_debug_level > 9)
00087 {
00088 ACE_DEBUG ((LM_TRACE,
00089 ACE_TEXT ("QOS_PubSub_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
00090 ACE_TEXT ("Set presentation ordered_access to <%d>\n"),
00091 dds_qos.presentation.ordered_access));
00092 }
00093 }
00094 }
00095
00096 if (xml_qos->partition_p ())
00097 {
00098 if (xml_qos->partition ().name_p ())
00099 {
00100 dds_qos.partition.name.length(static_cast<CORBA::ULong>(xml_qos->partition().name().count_element()));
00101 CORBA::ULong pos = 0;
00102 for (::dds::stringSeq::element_const_iterator it = xml_qos->partition ().name ().begin_element ();
00103 it != xml_qos->partition ().name ().end_element ();
00104 ++it, ++pos)
00105 {
00106 dds_qos.partition.name[pos] = ::CORBA::string_dup (it->get()->c_str());
00107
00108 if (OpenDDS::DCPS::DCPS_debug_level > 9)
00109 {
00110 ACE_DEBUG ((LM_TRACE,
00111 ACE_TEXT ("QOS_PubSub_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
00112 ACE_TEXT ("New name <%C> inserted in partition at position <%u>\n"),
00113 dds_qos.partition.name[pos].in (), pos));
00114 }
00115 }
00116 }
00117 }
00118
00119 if (xml_qos->entity_factory_p ())
00120 {
00121 if (xml_qos->entity_factory ().autoenable_created_entities_p ())
00122 {
00123 dds_qos.entity_factory.autoenable_created_entities =
00124 xml_qos->entity_factory ().autoenable_created_entities ();
00125
00126 if (OpenDDS::DCPS::DCPS_debug_level > 9)
00127 {
00128 ACE_DEBUG ((LM_TRACE,
00129 ACE_TEXT ("QOS_PubSub_T<XML_QOS_TYPE, DDS_QOS_TYPE>::read_qos - ")
00130 ACE_TEXT ("Set entity_factory autoenable_created_entities to <%d>\n"),
00131 dds_qos.entity_factory.autoenable_created_entities));
00132 }
00133 }
00134 }
00135 }
00136
00137 OPENDDS_END_VERSIONED_NAMESPACE_DECL