DataReaderQos_Handler.cpp

Go to the documentation of this file.
00001 #include "DataReaderQos_Handler.h"
00002 #include "QOS_DataReader_T.h"
00003 #include "dds/DCPS/debug.h"
00004 
00005 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL
00006 
00007 bool
00008 DataReaderQos_Handler::get_datareader_qos (DDS::DataReaderQos& dr_qos,
00009                                            dds::qosProfile * profile,
00010                                            const ACE_TCHAR * name)
00011 {
00012   if (name)
00013     {
00014 //       // find the correct DataReader_qos
00015 //       for (dds::qosProfile::DataReader_qos_iterator dw_it = profile->begin_DataReader_qos ();
00016 //           dw_it != profile->end_DataReader_qos();
00017 //           ++dw_it)
00018 //         {
00019 //           if (ACE_OS::strcmp (dw_name.c_str (), name) == 0)
00020 //             {
00021 //               return get_DataReader_qos (dw_qos, *dw_it->get());
00022 //             }
00023 //         }
00024     }
00025   else
00026     {
00027       if (profile->count_datareader_qos () == 0)
00028         {
00029           if (OpenDDS::DCPS::DCPS_debug_level > 7)
00030             {
00031               ACE_DEBUG ((LM_TRACE,
00032                 ACE_TEXT ("DataReaderQos_Handler::get_datareader_qos - ")
00033                 ACE_TEXT ("No DataReader QOS available in profile <%C>\n"),
00034                 profile->name ().c_str ()));
00035             }
00036           return true;
00037         }
00038       // get the first DataReader in the XML
00039       dds::qosProfile::datareader_qos_iterator dr_it = profile->begin_datareader_qos ();
00040       return DataReaderQos_Handler::get_datareader_qos (dr_qos, dr_it->get ());
00041     }
00042 
00043   ACE_ERROR ((LM_DEBUG,
00044     ACE_TEXT ("DataReaderQos_Handler::get_datareader_qos - ")
00045     ACE_TEXT ("Unable to find DataReaderQos <%C>\n"),
00046     name));
00047   return false;
00048 }
00049 
00050 bool
00051 DataReaderQos_Handler::get_datareader_qos (DDS::DataReaderQos& dr_qos,
00052                                            dds::datareaderQos * dr)
00053 {
00054   typedef QOS_DataReader_T<dds::datareaderQos*, DDS::DataReaderQos> dr_type;
00055   dr_type datareader_qos_handler;
00056   datareader_qos_handler.read_qos (dr_qos, dr);
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