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