From cdb9770939c8ba5818fc4c24966c7c58ba12d6c6 Mon Sep 17 00:00:00 2001 From: "Danilo C. Zanella" Date: Mon, 22 Feb 2021 14:33:06 +0000 Subject: [PATCH 1/2] Modified QOS_XML_Handler to add support for parse through memory buffer. --- dds/DCPS/QOS_XML_Handler/XML_File_Intf.cpp | 258 +---------------- dds/DCPS/QOS_XML_Handler/XML_File_Intf.h | 53 +--- dds/DCPS/QOS_XML_Handler/XML_Intf.cpp | 285 +++++++++++++++++++ dds/DCPS/QOS_XML_Handler/XML_Intf.h | 121 ++++++++ dds/DCPS/QOS_XML_Handler/XML_MemBuf_Intf.cpp | 235 +++++++++++++++ dds/DCPS/QOS_XML_Handler/XML_MemBuf_Intf.h | 91 ++++++ dds/DCPS/QOS_XML_Handler/qos_xml_handler.mpc | 5 + 7 files changed, 745 insertions(+), 303 deletions(-) create mode 100644 dds/DCPS/QOS_XML_Handler/XML_Intf.cpp create mode 100644 dds/DCPS/QOS_XML_Handler/XML_Intf.h create mode 100644 dds/DCPS/QOS_XML_Handler/XML_MemBuf_Intf.cpp create mode 100644 dds/DCPS/QOS_XML_Handler/XML_MemBuf_Intf.h diff --git a/dds/DCPS/QOS_XML_Handler/XML_File_Intf.cpp b/dds/DCPS/QOS_XML_Handler/XML_File_Intf.cpp index 7c02d76f4..a670537ab 100644 --- a/dds/DCPS/QOS_XML_Handler/XML_File_Intf.cpp +++ b/dds/DCPS/QOS_XML_Handler/XML_File_Intf.cpp @@ -17,7 +17,8 @@ OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL namespace OpenDDS { namespace DCPS { - QOS_XML_File_Handler::QOS_XML_File_Handler (void) + QOS_XML_File_Handler::QOS_XML_File_Handler (void) : + QOS_XML_Handler() { } @@ -73,7 +74,7 @@ namespace DCPS { ID_Map::TSS_ID_Map* TSS_ID_Map (ACE_Singleton::instance()); (*TSS_ID_Map)->reset (); - this->profiles_ = dds::reader::dds (dom); + profiles_ = dds::reader::dds (dom); } catch (const CORBA::Exception &ex) { @@ -95,259 +96,6 @@ namespace DCPS { return retcode; } - ::dds::qosProfile * - QOS_XML_File_Handler::get_profile (const char * profile_name) - { - for (::dds::qosProfile_seq::qos_profile_const_iterator it = this->profiles_.begin_qos_profile (); - it != this->profiles_.end_qos_profile (); - ++it) - { - if (ACE_OS::strcmp ((*it)->name ().c_str (), profile_name) == 0) - { - if (DCPS_debug_level > 7) - { - ACE_DEBUG ((LM_TRACE, - ACE_TEXT ("QOS_XML_File_Handler::get_profile - ") - ACE_TEXT ("Found profile <%C>\n"), - (*it)->name ().c_str ())); - } - return it->get(); - } - } - if (ACE_OS::strlen (profile_name) == 0) - { - ACE_ERROR ((LM_DEBUG, - ACE_TEXT ("QOS_XML_File_Handler::get_profile - ") - ACE_TEXT ("No profile specified\n"))); - } - else - { - ACE_ERROR ((LM_TRACE, - ACE_TEXT ("QOS_XML_File_Handler::get_profile - ") - ACE_TEXT ("Did not find profile <%C>\n"), - profile_name)); - } - return 0; - } - - DDS::ReturnCode_t - QOS_XML_File_Handler::get_datawriter_qos (::DDS::DataWriterQos& dw_qos, - const char * profile_name, - const char * topic_name) - { - ACE_UNUSED_ARG (topic_name); - - DDS::ReturnCode_t retcode = DDS::RETCODE_ERROR; - try - { - ::dds::qosProfile * profile = this->get_profile (profile_name); - if (profile != 0) - { - DataWriterQos_Handler::get_datawriter_qos (dw_qos, profile); - retcode = ::DDS::RETCODE_OK; - } - else - retcode = DDS::RETCODE_BAD_PARAMETER; - } - catch (const CORBA::Exception &ex) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("QOS_XML_File_Handler::get_datawriter_qos - ") - ACE_TEXT ("Caught CORBA exception whilst parsing XML into IDL: %C\n"), - ex._info ().c_str ())); - retcode = DDS::RETCODE_ERROR; - } - catch (...) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("QOS_XML_File_Handler::get_datawriter_qos - ") - ACE_TEXT ("Unexpected exception whilst parsing XML into IDL.\n"))); - retcode = DDS::RETCODE_ERROR; - } - - return retcode; - } - - DDS::ReturnCode_t - QOS_XML_File_Handler::get_datareader_qos (::DDS::DataReaderQos& dr_qos, - const char * profile_name, - const char * topic_name) - { - ACE_UNUSED_ARG (topic_name); - - DDS::ReturnCode_t retcode = DDS::RETCODE_ERROR; - try - { - ::dds::qosProfile * profile = this->get_profile (profile_name); - if (profile != 0) - { - DataReaderQos_Handler::get_datareader_qos (dr_qos, profile); - retcode = ::DDS::RETCODE_OK; - } - else - retcode = DDS::RETCODE_BAD_PARAMETER; - } - catch (const CORBA::Exception &ex) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("QOS_XML_File_Handler::get_datareader_qos - ") - ACE_TEXT ("Caught CORBA exception whilst parsing XML into IDL: %C\n"), - ex._info ().c_str ())); - retcode = DDS::RETCODE_ERROR; - } - catch (...) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("QOS_XML_File_Handler::get_datareader_qos - ") - ACE_TEXT ("Unexpected exception whilst parsing XML into IDL.\n"))); - retcode = DDS::RETCODE_ERROR; - } - - return retcode; - } - - DDS::ReturnCode_t - QOS_XML_File_Handler::get_topic_qos (::DDS::TopicQos& tp_qos, - const char * profile_name, - const char * topic_name) - { - ACE_UNUSED_ARG (topic_name); - - DDS::ReturnCode_t retcode = DDS::RETCODE_ERROR; - try - { - ::dds::qosProfile * profile = this->get_profile (profile_name); - if (profile != 0) - { - TopicQos_Handler::get_topic_qos (tp_qos, profile); - retcode = ::DDS::RETCODE_OK; - } - else - retcode = DDS::RETCODE_BAD_PARAMETER; - } - catch (const CORBA::Exception &ex) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("QOS_XML_File_Handler::get_topic_qos - ") - ACE_TEXT ("Caught CORBA exception whilst parsing XML into IDL: %C\n"), - ex._info ().c_str ())); - retcode = DDS::RETCODE_ERROR; - } - catch (...) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("QOS_XML_File_Handler::get_topic_qos - ") - ACE_TEXT ("Unexpected exception whilst parsing XML into IDL.\n"))); - retcode = DDS::RETCODE_ERROR; - } - - return retcode; - } - - DDS::ReturnCode_t - QOS_XML_File_Handler::get_publisher_qos (::DDS::PublisherQos& pub_qos, - const char * profile_name) - { - DDS::ReturnCode_t retcode = DDS::RETCODE_ERROR; - try - { - ::dds::qosProfile * profile = this->get_profile (profile_name); - if (profile != 0) - { - PublisherQos_Handler::get_publisher_qos (pub_qos, profile); - retcode = ::DDS::RETCODE_OK; - } - else - retcode = DDS::RETCODE_BAD_PARAMETER; - } - catch (const CORBA::Exception &ex) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("QOS_XML_File_Handler::get_publisher_qos - ") - ACE_TEXT ("Caught CORBA exception whilst parsing XML into IDL: %C\n"), - ex._info ().c_str ())); - retcode = DDS::RETCODE_ERROR; - } - catch (...) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("QOS_XML_File_Handler::get_publisher_qos - ") - ACE_TEXT ("Unexpected exception whilst parsing XML into IDL.\n"))); - retcode = DDS::RETCODE_ERROR; - } - - return retcode; - } - - DDS::ReturnCode_t - QOS_XML_File_Handler::get_subscriber_qos (::DDS::SubscriberQos& sub_qos, - const char * profile_name) - { - DDS::ReturnCode_t retcode = DDS::RETCODE_ERROR; - try - { - ::dds::qosProfile * profile = this->get_profile (profile_name); - if (profile != 0) - { - SubscriberQos_Handler::get_subscriber_qos (sub_qos, profile); - retcode = ::DDS::RETCODE_OK; - } - else - retcode = DDS::RETCODE_BAD_PARAMETER; - } - catch (const CORBA::Exception &ex) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("QOS_XML_File_Handler::get_subscriber_qos - ") - ACE_TEXT ("Caught CORBA exception whilst parsing XML into IDL: %C\n"), - ex._info ().c_str ())); - retcode = DDS::RETCODE_ERROR; - } - catch (...) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("QOS_XML_File_Handler::get_subscriber_qos - ") - ACE_TEXT ("Unexpected exception whilst parsing XML into IDL.\n"))); - retcode = DDS::RETCODE_ERROR; - } - - return retcode; - } - - DDS::ReturnCode_t - QOS_XML_File_Handler::get_participant_qos (::DDS::DomainParticipantQos& sub_qos, - const char * profile_name) - { - DDS::ReturnCode_t retcode = DDS::RETCODE_ERROR; - try - { - ::dds::qosProfile * profile = this->get_profile (profile_name); - if (profile != 0) - { - ParticipantQos_Handler::get_participant_qos (sub_qos, profile); - retcode = ::DDS::RETCODE_OK; - } - else - retcode = DDS::RETCODE_BAD_PARAMETER; - } - catch (const CORBA::Exception &ex) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("QOS_XML_File_Handler::get_participant_qos - ") - ACE_TEXT ("Caught CORBA exception whilst parsing XML into IDL: %C\n"), - ex._info ().c_str ())); - retcode = DDS::RETCODE_ERROR; - } - catch (...) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("QOS_XML_File_Handler::get_participant_qos - ") - ACE_TEXT ("Unexpected exception whilst parsing XML into IDL.\n"))); - retcode = DDS::RETCODE_ERROR; - } - - return retcode; - } void QOS_XML_File_Handler::add_search_path (const ACE_TCHAR *environment, diff --git a/dds/DCPS/QOS_XML_Handler/XML_File_Intf.h b/dds/DCPS/QOS_XML_Handler/XML_File_Intf.h index d09150290..2ae1d8a44 100644 --- a/dds/DCPS/QOS_XML_Handler/XML_File_Intf.h +++ b/dds/DCPS/QOS_XML_Handler/XML_File_Intf.h @@ -4,6 +4,7 @@ * * * @author Marcel Smit (msmit@remedy.nl) + * @author Danilo C. Zanella (dczanella@gmail.com) */ //================================================================ @@ -16,8 +17,10 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "dds_qos.hpp" +#include "XML_Intf.h" #include "dds/DdsDcpsInfrastructureC.h" #include "dds/DCPS/QOS_XML_Handler/XML_QOS_Handler_Export.h" +#include "ace/XML_Utils/XML_Helper.h" namespace XML { @@ -29,7 +32,8 @@ OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL namespace OpenDDS { namespace DCPS { - class XML_QOS_Handler_Export QOS_XML_File_Handler + class XML_QOS_Handler_Export QOS_XML_File_Handler : + virtual public QOS_XML_Handler { public: QOS_XML_File_Handler (void); @@ -49,45 +53,6 @@ namespace DCPS { init (const ACE_TCHAR * file); - //@{ - /** - * - * These methods will search for the profileQos in - * profiles_, using the given profile_name. - * If found, these methods will invoke - * the corresponding method on the corresponding Handler - * class. - * These classes are available in the - * xxxQos_Handler.h files. - * - */ - DDS::ReturnCode_t - get_datawriter_qos (::DDS::DataWriterQos& dw_qos, - const char * profile_name, - const char * topic_name); - - DDS::ReturnCode_t - get_datareader_qos (::DDS::DataReaderQos& dr_qos, - const char * profile_name, - const char * topic_name); - - DDS::ReturnCode_t - get_topic_qos (::DDS::TopicQos& tp_qos, - const char * profile_name, - const char * topic_name); - - DDS::ReturnCode_t - get_publisher_qos (::DDS::PublisherQos& pub_qos, - const char * profile_name); - - DDS::ReturnCode_t - get_subscriber_qos (::DDS::SubscriberQos& sub_qos, - const char * profile_name); - - DDS::ReturnCode_t - get_participant_qos (::DDS::DomainParticipantQos& sub_qos, - const char * profile_name); - //@} /** * @@ -101,16 +66,8 @@ namespace DCPS { const ACE_TCHAR *relpath); private: - ::dds::qosProfile_seq profiles_; typedef XML::XML_Typedef XML_Helper_type; - /** - * - * Searches for the profile in the XML file, using the given - * profile name. - * - */ - ::dds::qosProfile * get_profile (const char * profile_name); }; } } diff --git a/dds/DCPS/QOS_XML_Handler/XML_Intf.cpp b/dds/DCPS/QOS_XML_Handler/XML_Intf.cpp new file mode 100644 index 000000000..44a762929 --- /dev/null +++ b/dds/DCPS/QOS_XML_Handler/XML_Intf.cpp @@ -0,0 +1,285 @@ + +#include "XML_Intf.h" +#include "ace/XML_Utils/XML_Typedefs.h" +#include "ace/XML_Utils/XMLSchema/id_map.hpp" + +#include "DataReaderQos_Handler.h" +#include "DataWriterQos_Handler.h" +#include "TopicQos_Handler.h" +#include "PublisherQos_Handler.h" +#include "SubscriberQos_Handler.h" +#include "ParticipantQos_Handler.h" + +#include "dds/DCPS/debug.h" + +OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL + +namespace OpenDDS { +namespace DCPS { + + QOS_XML_Handler::QOS_XML_Handler (void) + { + } + + QOS_XML_Handler::~QOS_XML_Handler (void) + { + } + + ::dds::qosProfile * + QOS_XML_Handler::get_profile (const char * profile_name) + { + for (::dds::qosProfile_seq::qos_profile_const_iterator it = this->profiles_.begin_qos_profile (); + it != this->profiles_.end_qos_profile (); + ++it) + { + if (ACE_OS::strcmp ((*it)->name ().c_str (), profile_name) == 0) + { + if (DCPS_debug_level > 7) + { + ACE_DEBUG ((LM_TRACE, + ACE_TEXT ("QOS_XML_Handler::get_profile - ") + ACE_TEXT ("Found profile <%C>\n"), + (*it)->name ().c_str ())); + } + return it->get(); + } + } + if (ACE_OS::strlen (profile_name) == 0) + { + ACE_ERROR ((LM_DEBUG, + ACE_TEXT ("QOS_XML_Handler::get_profile - ") + ACE_TEXT ("No profile specified\n"))); + } + else + { + ACE_ERROR ((LM_TRACE, + ACE_TEXT ("QOS_XML_Handler::get_profile - ") + ACE_TEXT ("Did not find profile <%C>\n"), + profile_name)); + } + return 0; + } + + DDS::ReturnCode_t + QOS_XML_Handler::get_datawriter_qos (::DDS::DataWriterQos& dw_qos, + const char * profile_name, + const char * topic_name) + { + ACE_UNUSED_ARG (topic_name); + + DDS::ReturnCode_t retcode = DDS::RETCODE_ERROR; + try + { + ::dds::qosProfile * profile = this->get_profile (profile_name); + if (profile != 0) + { + DataWriterQos_Handler::get_datawriter_qos (dw_qos, profile); + retcode = ::DDS::RETCODE_OK; + } + else + retcode = DDS::RETCODE_BAD_PARAMETER; + } + catch (const CORBA::Exception &ex) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("QOS_XML_Handler::get_datawriter_qos - ") + ACE_TEXT ("Caught CORBA exception whilst parsing XML into IDL: %C\n"), + ex._info ().c_str ())); + retcode = DDS::RETCODE_ERROR; + } + catch (...) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("QOS_XML_Handler::get_datawriter_qos - ") + ACE_TEXT ("Unexpected exception whilst parsing XML into IDL.\n"))); + retcode = DDS::RETCODE_ERROR; + } + + return retcode; + } + + DDS::ReturnCode_t + QOS_XML_Handler::get_datareader_qos (::DDS::DataReaderQos& dr_qos, + const char * profile_name, + const char * topic_name) + { + ACE_UNUSED_ARG (topic_name); + + DDS::ReturnCode_t retcode = DDS::RETCODE_ERROR; + try + { + ::dds::qosProfile * profile = this->get_profile (profile_name); + if (profile != 0) + { + DataReaderQos_Handler::get_datareader_qos (dr_qos, profile); + retcode = ::DDS::RETCODE_OK; + } + else + retcode = DDS::RETCODE_BAD_PARAMETER; + } + catch (const CORBA::Exception &ex) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("QOS_XML_Handler::get_datareader_qos - ") + ACE_TEXT ("Caught CORBA exception whilst parsing XML into IDL: %C\n"), + ex._info ().c_str ())); + retcode = DDS::RETCODE_ERROR; + } + catch (...) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("QOS_XML_Handler::get_datareader_qos - ") + ACE_TEXT ("Unexpected exception whilst parsing XML into IDL.\n"))); + retcode = DDS::RETCODE_ERROR; + } + + return retcode; + } + + DDS::ReturnCode_t + QOS_XML_Handler::get_topic_qos (::DDS::TopicQos& tp_qos, + const char * profile_name, + const char * topic_name) + { + ACE_UNUSED_ARG (topic_name); + + DDS::ReturnCode_t retcode = DDS::RETCODE_ERROR; + try + { + ::dds::qosProfile * profile = this->get_profile (profile_name); + if (profile != 0) + { + TopicQos_Handler::get_topic_qos (tp_qos, profile); + retcode = ::DDS::RETCODE_OK; + } + else + retcode = DDS::RETCODE_BAD_PARAMETER; + } + catch (const CORBA::Exception &ex) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("QOS_XML_Handler::get_topic_qos - ") + ACE_TEXT ("Caught CORBA exception whilst parsing XML into IDL: %C\n"), + ex._info ().c_str ())); + retcode = DDS::RETCODE_ERROR; + } + catch (...) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("QOS_XML_Handler::get_topic_qos - ") + ACE_TEXT ("Unexpected exception whilst parsing XML into IDL.\n"))); + retcode = DDS::RETCODE_ERROR; + } + + return retcode; + } + + DDS::ReturnCode_t + QOS_XML_Handler::get_publisher_qos (::DDS::PublisherQos& pub_qos, + const char * profile_name) + { + DDS::ReturnCode_t retcode = DDS::RETCODE_ERROR; + try + { + ::dds::qosProfile * profile = this->get_profile (profile_name); + if (profile != 0) + { + PublisherQos_Handler::get_publisher_qos (pub_qos, profile); + retcode = ::DDS::RETCODE_OK; + } + else + retcode = DDS::RETCODE_BAD_PARAMETER; + } + catch (const CORBA::Exception &ex) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("QOS_XML_Handler::get_publisher_qos - ") + ACE_TEXT ("Caught CORBA exception whilst parsing XML into IDL: %C\n"), + ex._info ().c_str ())); + retcode = DDS::RETCODE_ERROR; + } + catch (...) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("QOS_XML_Handler::get_publisher_qos - ") + ACE_TEXT ("Unexpected exception whilst parsing XML into IDL.\n"))); + retcode = DDS::RETCODE_ERROR; + } + + return retcode; + } + + DDS::ReturnCode_t + QOS_XML_Handler::get_subscriber_qos (::DDS::SubscriberQos& sub_qos, + const char * profile_name) + { + DDS::ReturnCode_t retcode = DDS::RETCODE_ERROR; + try + { + ::dds::qosProfile * profile = this->get_profile (profile_name); + if (profile != 0) + { + SubscriberQos_Handler::get_subscriber_qos (sub_qos, profile); + retcode = ::DDS::RETCODE_OK; + } + else + retcode = DDS::RETCODE_BAD_PARAMETER; + } + catch (const CORBA::Exception &ex) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("QOS_XML_Handler::get_subscriber_qos - ") + ACE_TEXT ("Caught CORBA exception whilst parsing XML into IDL: %C\n"), + ex._info ().c_str ())); + retcode = DDS::RETCODE_ERROR; + } + catch (...) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("QOS_XML_Handler::get_subscriber_qos - ") + ACE_TEXT ("Unexpected exception whilst parsing XML into IDL.\n"))); + retcode = DDS::RETCODE_ERROR; + } + + return retcode; + } + + DDS::ReturnCode_t + QOS_XML_Handler::get_participant_qos (::DDS::DomainParticipantQos& sub_qos, + const char * profile_name) + { + DDS::ReturnCode_t retcode = DDS::RETCODE_ERROR; + try + { + ::dds::qosProfile * profile = this->get_profile (profile_name); + if (profile != 0) + { + ParticipantQos_Handler::get_participant_qos (sub_qos, profile); + retcode = ::DDS::RETCODE_OK; + } + else + retcode = DDS::RETCODE_BAD_PARAMETER; + } + catch (const CORBA::Exception &ex) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("QOS_XML_Handler::get_participant_qos - ") + ACE_TEXT ("Caught CORBA exception whilst parsing XML into IDL: %C\n"), + ex._info ().c_str ())); + retcode = DDS::RETCODE_ERROR; + } + catch (...) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("QOS_XML_Handler::get_participant_qos - ") + ACE_TEXT ("Unexpected exception whilst parsing XML into IDL.\n"))); + retcode = DDS::RETCODE_ERROR; + } + + return retcode; + } + +} +} + +OPENDDS_END_VERSIONED_NAMESPACE_DECL diff --git a/dds/DCPS/QOS_XML_Handler/XML_Intf.h b/dds/DCPS/QOS_XML_Handler/XML_Intf.h new file mode 100644 index 000000000..57a574539 --- /dev/null +++ b/dds/DCPS/QOS_XML_Handler/XML_Intf.h @@ -0,0 +1,121 @@ +//============================================================== +/** + * @file XML_Intf.h + * + * + * @author Danilo C. Zanellla (dczanella@gmail.com) + */ +//================================================================ + +#ifndef DCPS_CONFIG_XML_INTF_H +#define DCPS_CONFIG_XML_INTF_H +#include /**/ "ace/pre.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "dds_qos.hpp" +#include "dds/DdsDcpsInfrastructureC.h" +#include "dds/DCPS/QOS_XML_Handler/XML_QOS_Handler_Export.h" + +namespace XML +{ + class XML_Typedef; +} + +OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL + +namespace OpenDDS { +namespace DCPS { + + class XML_QOS_Handler_Export QOS_XML_Handler + { + public: + QOS_XML_Handler (void); + + virtual ~QOS_XML_Handler (void); + + /** + * + * init + * + * The init method interface method. It will validate + * it against the schema. It returns RETCODE_ERROR + * when any error occurs during parsing + * + */ + virtual DDS::ReturnCode_t + init (const ACE_TCHAR * file) = 0; + + + //@{ + /** + * + * These methods will search for the profileQos in + * profiles_, using the given profile_name. + * If found, these methods will invoke + * the corresponding method on the corresponding Handler + * class. + * These classes are available in the + * xxxQos_Handler.h files. + * + */ + virtual DDS::ReturnCode_t + get_datawriter_qos (::DDS::DataWriterQos& dw_qos, + const char * profile_name, + const char * topic_name); + + virtual DDS::ReturnCode_t + get_datareader_qos (::DDS::DataReaderQos& dr_qos, + const char * profile_name, + const char * topic_name); + + virtual DDS::ReturnCode_t + get_topic_qos (::DDS::TopicQos& tp_qos, + const char * profile_name, + const char * topic_name); + + virtual DDS::ReturnCode_t + get_publisher_qos (::DDS::PublisherQos& pub_qos, + const char * profile_name); + + virtual DDS::ReturnCode_t + get_subscriber_qos (::DDS::SubscriberQos& sub_qos, + const char * profile_name); + + virtual DDS::ReturnCode_t + get_participant_qos (::DDS::DomainParticipantQos& sub_qos, + const char * profile_name); + //@} + + /** + * + * add_search_path will add a relative path to the XML + * parsing library. The XML parsing library will use + * this path to search for the schema + * + */ + virtual void + add_search_path (const ACE_TCHAR *environment, + const ACE_TCHAR *relpath) = 0; + + protected: + ::dds::qosProfile_seq profiles_; + + /** + * + * Searches for the profile in the XML file, using the given + * profile name. + * + */ + virtual ::dds::qosProfile * get_profile (const char * profile_name); + }; +} +} + +OPENDDS_END_VERSIONED_NAMESPACE_DECL + +#include /**/ "ace/post.h" + +#endif /* DCPS_CONFIG_XML_INTF_H */ diff --git a/dds/DCPS/QOS_XML_Handler/XML_MemBuf_Intf.cpp b/dds/DCPS/QOS_XML_Handler/XML_MemBuf_Intf.cpp new file mode 100644 index 000000000..0d72fab21 --- /dev/null +++ b/dds/DCPS/QOS_XML_Handler/XML_MemBuf_Intf.cpp @@ -0,0 +1,235 @@ +#include "XML_MemBuf_Intf.h" +#include "xercesc/util/XercesDefs.hpp" +#include "xercesc/framework/MemBufInputSource.hpp" +#include "xercesc/parsers/XercesDOMParser.hpp" +#include "xercesc/sax/SAXParseException.hpp" + +#include "DataReaderQos_Handler.h" +#include "DataWriterQos_Handler.h" +#include "TopicQos_Handler.h" +#include "PublisherQos_Handler.h" +#include "SubscriberQos_Handler.h" +#include "ParticipantQos_Handler.h" + +#include "dds/DCPS/debug.h" + +OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL +XERCES_CPP_NAMESPACE_USE + +namespace OpenDDS { +namespace DCPS { + + QOS_XML_MemBuf_Handler::QOS_XML_MemBuf_Handler (void) : + QOS_XML_Handler(), + res_(new XML::XML_Schema_Resolver()), + eh_(new XML::XML_Error_Handler()) + { + try + { + // Call Initialize if not already called + XMLPlatformUtils::Initialize(); + + //////////////// + // Create parser + parser_ = new XercesDOMParser(); + + // Create a DomImplementation + DOMImplementation * domImpl = DOMImplementationRegistry::getDOMImplementation(XMLString::transcode("XML 1.0")); + // Create a temporary document with a generic element + // it shall be replaced in future with final version + finalDoc_ = domImpl->createDocument( + XMLString::transcode(""), + XMLString::transcode("temp"), + NULL); + + } catch (const XMLException& toCatch) { + + char* message = XMLString::transcode(toCatch.getMessage()); + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("QOS_XML_MemBuf_Handler::QOS_XML_MemBuf_Handler - ") + ACE_TEXT ("Error during XML initialization! :\n<%C>\n"), + message)); + XMLString::release(&message); + } + } + + QOS_XML_MemBuf_Handler::~QOS_XML_MemBuf_Handler (void) + { + if (finalDoc_ != NULL) + finalDoc_->release(); + if (parser_ != NULL) + delete parser_; + if (res_ != NULL) + delete res_; + if (eh_ != NULL) + delete eh_; + + // Do your actual work with Xerces-C++ here. + XMLPlatformUtils::Terminate(); + } + + DDS::ReturnCode_t + QOS_XML_MemBuf_Handler::init (const ACE_TCHAR * membuf) + { + DDS::ReturnCode_t retcode = DDS::RETCODE_OK; + try + { + // Create a InputSource to be used in parser with XML string + MemBufInputSource xmlBuf((const XMLByte*) membuf, (const XMLSize_t) strlen(membuf) ,"stream (in memory)"); + + /////////////////// + // Configure Parser + // + // Perform Namespace processing. + parser_->setDoNamespaces (true); + // Discard comment nodes in the document + parser_->setCreateCommentNodes (false); + // Disable datatype normalization. The XML 1.0 attribute value + // normalization always occurs though. + // parser_->setFeature (XMLUni::fgDOMDatatypeNormalization, true); + + // Do not create EntityReference nodes in the DOM tree. No + // EntityReference nodes will be created, only the nodes + // corresponding to their fully expanded sustitution text will be + // created. + parser_->setCreateEntityReferenceNodes (false); + // Perform Validation + parser_->setValidationScheme (xercesc::AbstractDOMParser::Val_Always); + // Do not include ignorable whitespace in the DOM tree. + parser_->setIncludeIgnorableWhitespace (false); + // Enable the parser_'s schema support. + parser_->setDoSchema (true); + // Enable full schema constraint checking, including checking which + // may be time-consuming or memory intensive. Currently, particle + // unique attribution constraint checking and particle derivation + // restriction checking are controlled by this option. + parser_->setValidationSchemaFullChecking (true); + // The parser_ will treat validation error as fatal and will exit. + //parser_->setValidationConstraintFatal (true); + + // Set resolver using auxiliary XML_Schema_Resolver + parser_->setEntityResolver(res_); + + // Set XML Error handler + parser_->setErrorHandler(eh_); + + // Parsing buffer + try { + ACE::debug(true); + parser_->parse(xmlBuf); + } + catch (const SAXParseException& toCatch) { + char* message = XMLString::transcode(toCatch.getMessage()); + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("QOS_XML_MemBuf_Handler::init - ") + ACE_TEXT ("Exception message is: <%C>\n"), + message)); + XMLString::release(&message); + return DDS::RETCODE_ERROR; + } + catch (const XMLException& toCatch) { + char* message = XMLString::transcode(toCatch.getMessage()); + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("QOS_XML_MemBuf_Handler::init - ") + ACE_TEXT ("Exception message is: <%C>\n"), + message)); + XMLString::release(&message); + return DDS::RETCODE_ERROR; + } + catch (const DOMException& toCatch) { + char* message = XMLString::transcode(toCatch.getMessage()); + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("QOS_XML_MemBuf_Handler::init - ") + ACE_TEXT ("Exception message is: <%C>\n"), + message)); + XMLString::release(&message); + return DDS::RETCODE_ERROR; + } + catch (...) { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("QOS_XML_MemBuf_Handler::init - ") + ACE_TEXT ("Unexpected exception\n") + )); + return DDS::RETCODE_ERROR; + } + ACE::debug(false); + + //// Check for errors + //if (eh_->getErrors()) + //{ + // std::cout << "Parse errors found" << std::endl; + // return DDS::RETCODE_ERROR; + //} + //else + // std::cout << "Nenhum error achado" << std::endl; + + DOMDocument * initialDoc = parser_->getDocument(); + if (initialDoc == 0) + { + if (DCPS_debug_level > 1) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("QOS_XML_Stream_Handler::init - ") + ACE_TEXT ("Failed to parse string \n") + )); + } + return DDS::RETCODE_ERROR; + } + + // Find "dds" node using the opendds namespace + DOMNodeList * ddsNodeList = initialDoc->getElementsByTagNameNS(XMLString::transcode("http://www.omg.org/dds"),XMLString::transcode("dds")); + + // Get the first node. It is expected to have only one + DOMNode * ddsNode = ddsNodeList->item(0); + if (DCPS_debug_level > 1) + { + char* message = XMLString::transcode(ddsNode->getNodeName()); + ACE_ERROR ((LM_INFO, + ACE_TEXT ("QOS_XML_MemBuf_Handler::init - ") + ACE_TEXT ("Node name: <%C>\n"), + message)); + XMLString::release(&message); + } + + DOMNode * clone = finalDoc_->importNode(ddsNode, true); + // Replace root element by the cloned one. Thus the root element + // shall be "dds" as required by dds::reader::dds function + finalDoc_->replaceChild(clone,finalDoc_->getDocumentElement()); + + ID_Map::TSS_ID_Map* TSS_ID_Map (ACE_Singleton::instance()); + (*TSS_ID_Map)->reset (); + + profiles_ = dds::reader::dds(finalDoc_); + + } + catch (const CORBA::Exception &ex) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("QOS_XML_Stream_Handler::init - ") + ACE_TEXT ("Caught CORBA exception whilst parsing XML\n"), + ex._info ().c_str ())); + retcode = DDS::RETCODE_ERROR; + } + catch (...) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("QOS_XML_Stream_Handler::init - ") + ACE_TEXT ("Unexpected exception whilst parsing XML.\n") + )); + retcode = DDS::RETCODE_ERROR; + } + return retcode; + + } + + void + QOS_XML_MemBuf_Handler::add_search_path (const ACE_TCHAR *environment, + const ACE_TCHAR *relpath) + { + res_->get_resolver().add_path(environment,relpath); + } + +} +} + +OPENDDS_END_VERSIONED_NAMESPACE_DECL diff --git a/dds/DCPS/QOS_XML_Handler/XML_MemBuf_Intf.h b/dds/DCPS/QOS_XML_Handler/XML_MemBuf_Intf.h new file mode 100644 index 000000000..e8618899a --- /dev/null +++ b/dds/DCPS/QOS_XML_Handler/XML_MemBuf_Intf.h @@ -0,0 +1,91 @@ +//============================================================== +/** + * @file XML_MemBuf_Intf.h + * + * + * @author Danilo C. Zanella (dczanella@gmail.com) + */ +//================================================================ + +#ifndef DCPS_CONFIG_XML_MEMBUF_INTF_H +#define DCPS_CONFIG_XML_MEMBUF_INTF_H +#include /**/ "ace/pre.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "dds_qos.hpp" +#include "XML_Intf.h" +#include "dds/DdsDcpsInfrastructureC.h" +#include "dds/DCPS/QOS_XML_Handler/XML_QOS_Handler_Export.h" +#include "ace/XML_Utils/XML_Typedefs.h" +#include "ace/XML_Utils/XML_Schema_Resolver.h" +#include "ace/XML_Utils/XML_Error_Handler.h" + +namespace XML +{ + class XML_Typedef; +} + +OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL + +namespace OpenDDS { +namespace DCPS { + + class XML_QOS_Handler_Export QOS_XML_MemBuf_Handler : + virtual public QOS_XML_Handler + { + public: + QOS_XML_MemBuf_Handler (void); + + ~QOS_XML_MemBuf_Handler (void); + + /** + * + * init + * + * The init method will parse a string and will validate + * it against the schema. This string is suposed to have a + * "dds" element with namespace "http://www.omg.org/dds". + * It returns RETCODE_ERROR + * when any error occurs during parsing + * + */ + DDS::ReturnCode_t + init (const ACE_TCHAR * membuf); + + /** + * + * add_search_path will add a relative path to the XML + * parsing library. The XML parsing library will use + * this path to search for the schema + * + */ + void + add_search_path (const ACE_TCHAR *environment, + const ACE_TCHAR *relpath); + + private: + // Schema resolver + XML::XML_Schema_Resolver * res_; + + // Error handler + XML::XML_Error_Handler * eh_; + + // Parser + XercesDOMParser * parser_; + + // Final DOMDocument that should be passed to + // dds::reader::dds method + DOMDocument * finalDoc_; + + }; +} +} + +OPENDDS_END_VERSIONED_NAMESPACE_DECL + +#include /**/ "ace/post.h" + +#endif /* DCPS_CONFIG_XML_MEMBUF_INTF_H */ diff --git a/dds/DCPS/QOS_XML_Handler/qos_xml_handler.mpc b/dds/DCPS/QOS_XML_Handler/qos_xml_handler.mpc index 9e5e5f38a..41b354dfa 100644 --- a/dds/DCPS/QOS_XML_Handler/qos_xml_handler.mpc +++ b/dds/DCPS/QOS_XML_Handler/qos_xml_handler.mpc @@ -32,7 +32,9 @@ project(OpenDDS_QOS_XML_XSC_Handler): install, ace_xml_utils, dcpslib { Source_Files { dds_qos.cpp + XML_Intf.cpp XML_File_Intf.cpp + XML_MemBuf_Intf.cpp QOS_XML_Loader.cpp DataWriterQos_Handler.cpp DataReaderQos_Handler.cpp @@ -45,6 +47,9 @@ project(OpenDDS_QOS_XML_XSC_Handler): install, ace_xml_utils, dcpslib { Header_Files { XML_QOS_Handler_Export.h + XML_Intf.h + XML_File_Intf.h + XML_MemBuf_Intf.h dds_qos.hpp QOS_Common.h DataWriterQos_Handler.h -- 2.20.1 From 658aef4900088cec58e233f57b2a2e4c18805b2d Mon Sep 17 00:00:00 2001 From: "Danilo C. Zanella" Date: Mon, 22 Feb 2021 14:35:49 +0000 Subject: [PATCH 2/2] Added dumpMemBuf test to check QOS_XML_Handler library to parse through the memory --- tests/DCPS/QoS_XML/dumpMemBuf/.gitignore | 1 + tests/DCPS/QoS_XML/dumpMemBuf/qos.xml | 276 ++++++++++++++++++ .../QoS_XML/dumpMemBuf/qos_dumpMemBuf.cpp | 136 +++++++++ .../QoS_XML/dumpMemBuf/qos_dumpMemBuf.mpc | 9 + tests/DCPS/QoS_XML/dumpMemBuf/run_test.pl | 20 ++ 5 files changed, 442 insertions(+) create mode 100644 tests/DCPS/QoS_XML/dumpMemBuf/.gitignore create mode 100644 tests/DCPS/QoS_XML/dumpMemBuf/qos.xml create mode 100644 tests/DCPS/QoS_XML/dumpMemBuf/qos_dumpMemBuf.cpp create mode 100644 tests/DCPS/QoS_XML/dumpMemBuf/qos_dumpMemBuf.mpc create mode 100755 tests/DCPS/QoS_XML/dumpMemBuf/run_test.pl diff --git a/tests/DCPS/QoS_XML/dumpMemBuf/.gitignore b/tests/DCPS/QoS_XML/dumpMemBuf/.gitignore new file mode 100644 index 000000000..3e045d698 --- /dev/null +++ b/tests/DCPS/QoS_XML/dumpMemBuf/.gitignore @@ -0,0 +1 @@ +/qos_dump diff --git a/tests/DCPS/QoS_XML/dumpMemBuf/qos.xml b/tests/DCPS/QoS_XML/dumpMemBuf/qos.xml new file mode 100644 index 000000000..980456693 --- /dev/null +++ b/tests/DCPS/QoS_XML/dumpMemBuf/qos.xml @@ -0,0 +1,276 @@ + + + + + + VOLATILE_DURABILITY_QOS + + + + DURATION_INFINITE_SEC + DURATION_INFINITE_NSEC + + + + + 0 + 0 + + + + AUTOMATIC_LIVELINESS_QOS + + DURATION_INFINITE_SEC + DURATION_INFINITE_NSEC + + + + BEST_EFFORT_RELIABILITY_QOS + + 0 + 100000000 + + + + BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS + + + KEEP_LAST_HISTORY_QOS + 1 + + + LENGTH_UNLIMITED + LENGTH_UNLIMITED + LENGTH_UNLIMITED + + + + SHARED_OWNERSHIP_QOS + + + + 0 + 0 + + + + + DURATION_INFINITE_SEC + DURATION_INFINITE_NSEC + + + DURATION_INFINITE_SEC + DURATION_INFINITE_NSEC + + + + + + VOLATILE_DURABILITY_QOS + + + + 0 + 0 + + KEEP_LAST_HISTORY_QOS + 1 + LENGTH_UNLIMITED + LENGTH_UNLIMITED + LENGTH_UNLIMITED + + + + DURATION_INFINITE_SEC + DURATION_INFINITE_NSEC + + + + + 0 + 0 + + + + AUTOMATIC_LIVELINESS_QOS + + DURATION_INFINITE_SEC + DURATION_INFINITE_NSEC + + + + RELIABLE_RELIABILITY_QOS + + 0 + 100000000 + + + + BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS + + + KEEP_ALL_HISTORY_QOS + 5 + + + LENGTH_UNLIMITED + LENGTH_UNLIMITED + LENGTH_UNLIMITED + + + 0 + + + + DURATION_INFINITE_SEC + DURATION_INFINITE_NSEC + + + + + SHARED_OWNERSHIP_QOS + + + 0 + + + true + + + + + + true + + + + + INSTANCE_PRESENTATION_QOS + false + false + + + + ABC + DEF + GHI + JKL + MNO + PQR + STU + VW + XYZ + + + + + true + + + + + INSTANCE_PRESENTATION_QOS + false + false + + + + XYZ + VW + STU + PQR + MNO + JKL + GHI + DEF + ABC + + + + + true + + + + + + VOLATILE_DURABILITY_QOS + + + + 0 + 0 + + KEEP_LAST_HISTORY_QOS + 1 + LENGTH_UNLIMITED + LENGTH_UNLIMITED + LENGTH_UNLIMITED + + + + DURATION_INFINITE_SEC + DURATION_INFINITE_NSEC + + + + + 0 + 0 + + + + AUTOMATIC_LIVELINESS_QOS + + DURATION_INFINITE_SEC + DURATION_INFINITE_NSEC + + + + BEST_EFFORT_RELIABILITY_QOS + + 0 + 100000000 + + + + BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS + + + KEEP_LAST_HISTORY_QOS + 1 + + + LENGTH_UNLIMITED + LENGTH_UNLIMITED + LENGTH_UNLIMITED + + + 0 + + + + DURATION_INFINITE_SEC + DURATION_INFINITE_NSEC + + + + SHARED_OWNERSHIP_QOS + + + + diff --git a/tests/DCPS/QoS_XML/dumpMemBuf/qos_dumpMemBuf.cpp b/tests/DCPS/QoS_XML/dumpMemBuf/qos_dumpMemBuf.cpp new file mode 100644 index 000000000..dc63c7d83 --- /dev/null +++ b/tests/DCPS/QoS_XML/dumpMemBuf/qos_dumpMemBuf.cpp @@ -0,0 +1,136 @@ +#include +#include +#include "dds/DCPS/QOS_XML_Handler/XML_MemBuf_Intf.h" +#include "dds/DdsDcpsC.h" + +int ACE_TMAIN (int, ACE_TCHAR *[]) +{ + int retval = 0; + try + { + // File name and profile name in respective file + const char * fileName = "qos.xml"; + const char * profileName = "TestProfile"; + const char * topicName = "TopicName"; + + // read file and create string + std::ifstream ifs(fileName); + std::stringstream buffer; + buffer << ifs.rdbuf(); + + OpenDDS::DCPS::QOS_XML_MemBuf_Handler xml_membuf; + // Add env variable and path to search schemas + xml_membuf.add_search_path("DDS_ROOT","/docs/schema/"); + // initialize and parse XML + DDS::ReturnCode_t const retcode = xml_membuf.init(buffer.str().c_str()); + + if (retcode == DDS::RETCODE_OK) + { + DDS::ReturnCode_t retcode_qos; + ::DDS::DataWriterQos dw_qos; + retcode_qos = xml_membuf.get_datawriter_qos ( + dw_qos, + profileName, + topicName); + if (retcode_qos != DDS::RETCODE_OK) + { + ACE_ERROR ((LM_ERROR, "MAIN - " + "get_datawriter_qos return an error. Retcode <%d>\n", + retcode_qos)); + ++retval; + } + if (dw_qos.history.kind != ::DDS::KEEP_ALL_HISTORY_QOS) + { + ACE_ERROR ((LM_ERROR, "MAIN - " + "get_datawriter_qos return an invalid history kind.\n")); + ++retval; + } + if (dw_qos.history.depth != 5) + { + ACE_ERROR ((LM_ERROR, "MAIN - " + "get_datawriter_qos return an invalid history depth.\n")); + ++retval; + } + + ::DDS::DataReaderQos dr_qos; + retcode_qos = xml_membuf.get_datareader_qos ( + dr_qos, + profileName, + topicName); + if (retcode_qos != DDS::RETCODE_OK) + { + ACE_ERROR ((LM_ERROR, "MAIN - " + "get_datareader_qos return an error. Retcode <%d>\n", + retcode_qos)); + ++retval; + } + + ::DDS::TopicQos tp_qos; + retcode_qos = xml_membuf.get_topic_qos ( + tp_qos, + profileName, + topicName); + if (retcode_qos != DDS::RETCODE_OK) + { + ACE_ERROR ((LM_ERROR, "MAIN - " + "get_topic_qos return an error. Retcode <%d>\n", + retcode_qos)); + ++retval; + } + + ::DDS::PublisherQos pub_qos; + retcode_qos = xml_membuf.get_publisher_qos ( + pub_qos, + profileName); + if (retcode_qos != DDS::RETCODE_OK) + { + ACE_ERROR ((LM_ERROR, "MAIN - " + "get_publisher_qos return an error. Retcode <%d>\n", + retcode_qos)); + ++retval; + } + + ::DDS::SubscriberQos sub_qos; + retcode_qos = xml_membuf.get_subscriber_qos ( + sub_qos, + profileName); + if (retcode_qos != DDS::RETCODE_OK) + { + ACE_ERROR ((LM_ERROR, "MAIN - " + "get_subscriber_qos return an error. Retcode <%d>\n", + retcode_qos)); + ++retval; + } + + ::DDS::DomainParticipantQos dp_qos; + retcode_qos = xml_membuf.get_participant_qos ( + dp_qos, + profileName); + if (retcode_qos != DDS::RETCODE_OK) + { + ACE_ERROR ((LM_ERROR, "MAIN - " + "get_participant_qos return an error. Retcode <%d>\n", + retcode_qos)); + ++retval; + } + } + else + { + ACE_ERROR ((LM_ERROR, "MAIN - Init return an error. Retcode <%d>\n", + retcode)); + ++retval; + } + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("QOS_Dump::main\n"); + return -1; + } + catch (...) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unexpected exception\n"))); + return 1; + } + + return retval; +} diff --git a/tests/DCPS/QoS_XML/dumpMemBuf/qos_dumpMemBuf.mpc b/tests/DCPS/QoS_XML/dumpMemBuf/qos_dumpMemBuf.mpc new file mode 100644 index 000000000..9de724576 --- /dev/null +++ b/tests/DCPS/QoS_XML/dumpMemBuf/qos_dumpMemBuf.mpc @@ -0,0 +1,9 @@ + +project : taoexe, dcps_qos_xml_handler { + exename = qos_dumpMemBuf + + Source_Files { + qos_dumpMemBuf.cpp + } +} + diff --git a/tests/DCPS/QoS_XML/dumpMemBuf/run_test.pl b/tests/DCPS/QoS_XML/dumpMemBuf/run_test.pl new file mode 100755 index 000000000..88953b798 --- /dev/null +++ b/tests/DCPS/QoS_XML/dumpMemBuf/run_test.pl @@ -0,0 +1,20 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# -*- perl -*- + +use lib "$ENV{ACE_ROOT}/bin"; +use PerlACE::TestTarget; + +my $program = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n"; + +$PROG = $program->CreateProcess ("qos_dump"); +$program_status = $PROG->SpawnWaitKill ($program->ProcessStartWaitInterval ()); + +if ($program_status != 0) { + print STDERR "ERROR: qos_dump returned $program_status\n"; + exit 1; +} + +exit 0; -- 2.20.1