DataWriterQos_Handler.cpp

Go to the documentation of this file.
00001 #include "DataWriterQos_Handler.h"
00002 #include "QOS_DataWriter_T.h"
00003 #include "dds/DCPS/debug.h"
00004 
00005 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL
00006 
00007 bool
00008 DataWriterQos_Handler::get_datawriter_qos (DDS::DataWriterQos& dw_qos,
00009                                            dds::qosProfile * profile,
00010                                            const ACE_TCHAR * name)
00011 {
00012   if (name)
00013     {
00014 //       // find the correct datawriter_qos
00015 //       for (dds::qosProfile::datawriter_qos_iterator dw_it = profile->begin_datawriter_qos ();
00016 //           dw_it != profile->end_datawriter_qos();
00017 //           ++dw_it)
00018 //         {
00019 //           if (ACE_OS::strcmp (dw_name.c_str (), name) == 0)
00020 //             {
00021 //               return get_datawriter_qos (dw_qos, *dw_it->get());
00022 //             }
00023 //         }
00024     }
00025   else
00026     {
00027       if (profile->count_datawriter_qos () == 0)
00028         {
00029           if (OpenDDS::DCPS::DCPS_debug_level > 7)
00030             {
00031               ACE_DEBUG ((LM_TRACE,
00032                 ACE_TEXT ("DataWriterQos_Handler::get_datawriter_qos - ")
00033                 ACE_TEXT ("No DataWriter QOS available in profile <%C>\n"),
00034                 profile->name ().c_str ()));
00035             }
00036           return true;
00037         }
00038       // get the first datawriter in the XML
00039       dds::qosProfile::datawriter_qos_iterator dw_it = profile->begin_datawriter_qos ();
00040       return DataWriterQos_Handler::get_datawriter_qos (dw_qos, dw_it->get ());
00041     }
00042 
00043   ACE_ERROR ((LM_DEBUG,
00044     ACE_TEXT ("DataWriterQos_Handler::get_datawriter_qos - ")
00045     ACE_TEXT ("Unable to find DataWriterQos <%C>\n"),
00046     name));
00047   return false;
00048 }
00049 
00050 bool
00051 DataWriterQos_Handler::get_datawriter_qos (DDS::DataWriterQos& dw_qos,
00052                                            dds::datawriterQos * dw)
00053 {
00054   typedef QOS_DataWriter_T<dds::datawriterQos*, DDS::DataWriterQos> dw_type;
00055   dw_type datawriter_qos_handler;
00056   datawriter_qos_handler.read_qos (dw_qos, dw);
00057 
00058   return true;
00059 }
00060 
00061 OPENDDS_END_VERSIONED_NAMESPACE_DECL
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 10 Aug 2018 for OpenDDS by  doxygen 1.6.1