summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormxiong <mxiong@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2006-03-24 16:53:58 +0000
committermxiong <mxiong@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2006-03-24 16:53:58 +0000
commitea5869cfb43e4454b303c18623ffbb8d187edb3b (patch)
tree9a0c6a6a83d4a7164529ac4c1d0640062f0fcd82
parentfaa70792b15dd047e536257a2c750bcb00fd2af3 (diff)
downloadATCD-ea5869cfb43e4454b303c18623ffbb8d187edb3b.tar.gz
ChangeLogTag:Fri Mar 24 16:53:15 UTC 2006 xiong,ming <ming.xiong@vanderbilt.edu>
-rw-r--r--TAO/CIAO/tools/Config_Handlers/CIAO_Events/CIAOEvents_Handler.cpp116
-rw-r--r--TAO/CIAO/tools/Config_Handlers/CIAO_Events/CIAOEvents_Handler.h72
-rw-r--r--TAO/CIAO/tools/Config_Handlers/CIAO_Events/CIAO_Events_Handlers.mpc20
-rw-r--r--TAO/CIAO/tools/Config_Handlers/CIAO_Events/CIAO_Events_Handlers_Export.h54
4 files changed, 262 insertions, 0 deletions
diff --git a/TAO/CIAO/tools/Config_Handlers/CIAO_Events/CIAOEvents_Handler.cpp b/TAO/CIAO/tools/Config_Handlers/CIAO_Events/CIAOEvents_Handler.cpp
new file mode 100644
index 00000000000..ffe688ffcdc
--- /dev/null
+++ b/TAO/CIAO/tools/Config_Handlers/CIAO_Events/CIAOEvents_Handler.cpp
@@ -0,0 +1,116 @@
+// $Id$
+#include "Utils/XML_Helper.h"
+#include "CIAOEvents_Handler.h"
+#include "CIAOEvents.hpp"
+#include "ciao/Deployment_EventsC.h"
+
+namespace CIAO
+{
+ namespace Config_Handlers
+ {
+ CIAOEvents_Handler::CIAOEvents_Handler (const ACE_TCHAR *file) :
+ idl_esd_(0),
+ esd_(0),
+ retval_ (false)
+ {
+ XML_Helper helper;
+
+ XERCES_CPP_NAMESPACE::DOMDocument *dom =
+ helper.create_dom (file);
+
+ if (!dom)
+ throw CIAOEvents_Handler::NoESD ();
+
+ this->esd_.reset (new CIAOEventsDef
+ (CIAOEvents (dom)));
+
+ if (!this->build_esd ())
+ throw NoESD ();
+ }
+
+ CIAOEvents_Handler::CIAOEvents_Handler (CIAOEventsDef *esd):
+ idl_esd_(0),
+ esd_(esd),
+ retval_(false)
+ {
+ if(!this->build_esd())
+ throw NoESD ();
+ }
+
+
+ CIAOEvents_Handler::~CIAOEvents_Handler (void)
+ {
+ }
+
+ bool
+ CIAOEvents_Handler::build_esd ()
+ {
+ this->idl_esd_.reset ( new ::CIAO::DAnCE::EventServiceDeploymentDescriptions );
+
+
+ CORBA::ULong num (this->idl_esd_->length ());
+
+ this->idl_esd_->length (this->esd_->count_eventServiceConfiguration ());
+
+ for (CIAOEventsDef::eventServiceConfiguration_const_iterator i = this->esd_->begin_eventServiceConfiguration ();
+ i != this->esd_->end_eventServiceConfiguration ();
+ i++)
+ {
+ CIAO::DAnCE::EventServiceDeploymentDescription a_esd;
+
+ a_esd.name = CORBA::string_dup (i->name ().c_str ());
+ a_esd.node = CORBA::string_dup (i->node ().c_str ());
+
+ switch (i->type ().integral ())
+ {
+ case ::CIAO::Config_Handlers::EventServiceType::EC_l:
+ a_esd.type = CIAO::DAnCE::EC;
+ break;
+ case ::CIAO::Config_Handlers::EventServiceType::NOTIFY_l:
+ a_esd.type = CIAO::DAnCE::NOTIFY;
+ break;
+ case ::CIAO::Config_Handlers::EventServiceType::RTEC_l:
+ a_esd.type = CIAO::DAnCE::RTEC;
+ break;
+ case ::CIAO::Config_Handlers::EventServiceType::RTNOTIFY_l:
+ a_esd.type = CIAO::DAnCE::RTNOTIFY;
+ break;
+ default:
+ ACE_ERROR ((LM_ERROR,
+ "Invalid event service type\n"));
+ return false;
+ }
+
+ a_esd.svc_cfg_file = CORBA::string_dup (i->svc_cfg_file ().c_str ());
+
+ (*this->idl_esd_)[num] = a_esd;
+ num++;
+ }
+ return true;
+ }
+
+
+ ::CIAO::DAnCE::EventServiceDeploymentDescriptions const *
+ CIAOEvents_Handler::esd_idl () const
+ throw (CIAOEvents_Handler::NoESD)
+ {
+ if(!this->idl_esd_.get())
+ throw NoESD ();
+
+ //else
+ return this->idl_esd_.get();
+ }
+
+ ::CIAO::DAnCE::EventServiceDeploymentDescriptions *
+ CIAOEvents_Handler::esd_idl ()
+ throw (CIAOEvents_Handler::NoESD)
+ {
+ if(!this->idl_esd_.get())
+ throw NoESD();
+
+ //else
+ return this->idl_esd_.release();
+ }
+ }
+}
+
diff --git a/TAO/CIAO/tools/Config_Handlers/CIAO_Events/CIAOEvents_Handler.h b/TAO/CIAO/tools/Config_Handlers/CIAO_Events/CIAOEvents_Handler.h
new file mode 100644
index 00000000000..d6a183deb0a
--- /dev/null
+++ b/TAO/CIAO/tools/Config_Handlers/CIAO_Events/CIAOEvents_Handler.h
@@ -0,0 +1,72 @@
+//================================================
+/**
+ * @file CIAOEvents_Handler.h
+ *
+ * $Id$
+ *
+ * @author Ming Xiong <mxiong@dre.vanderbilt.edu>
+ */
+//================================================
+
+#ifndef CIAO_CONFIG_HANDLERS_CIAOEvents_HANDLER_H
+#define CIAO_CONFIG_HANDLERS_CIAOEvents_HANDLER_H
+
+#include /**/ "ace/pre.h"
+
+#include "Utils/XML_Helper.h"
+#include "ciao/Deployment_EventsC.h"
+#include "CIAO_Events_Handlers_Export.h"
+#include "ciao/DeploymentC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
+namespace CIAO
+{
+ namespace Config_Handlers
+ {
+ class CIAOEventsDef;
+
+ /*
+ * @class CIAOEvents_Handler
+ *
+ * @brief Handler class for <CIAOEvents> types.
+ *
+ * This class defines handler methods to map values from
+ * XSC objects, parsed from the descriptor files, to the
+ * corresponding CORBA IDL type for the schema element.
+ *
+ */
+ class CIAO_Events_Handlers_Export CIAOEvents_Handler
+ {
+
+ public:
+ class NoESD {};
+
+ CIAOEvents_Handler (const ACE_TCHAR *file);
+
+ CIAOEvents_Handler(CIAOEventsDef *esd);
+
+ ~CIAOEvents_Handler (void);
+
+ CIAO::DAnCE::EventServiceDeploymentDescriptions const *esd_idl (void) const;
+
+ CIAO::DAnCE::EventServiceDeploymentDescriptions *esd_idl (void);
+
+ private:
+ bool build_esd ();
+
+ auto_ptr <CIAO::DAnCE::EventServiceDeploymentDescriptions > idl_esd_;
+
+ auto_ptr <CIAOEventsDef> esd_;
+
+ bool retval_;
+
+ };
+ }
+}
+
+#include /**/ "ace/post.h"
+#endif /* CIAO_CONFIG_HANDLERS_CIAOEvents_HANDLER_H*/
diff --git a/TAO/CIAO/tools/Config_Handlers/CIAO_Events/CIAO_Events_Handlers.mpc b/TAO/CIAO/tools/Config_Handlers/CIAO_Events/CIAO_Events_Handlers.mpc
new file mode 100644
index 00000000000..09bbc4c9194
--- /dev/null
+++ b/TAO/CIAO/tools/Config_Handlers/CIAO_Events/CIAO_Events_Handlers.mpc
@@ -0,0 +1,20 @@
+//$Id$
+
+project (CIAO_Events_Handlers) : acelib, ciao_deployment_stub, xerces {
+ sharedname = CIAO_Events_Handlers
+ dynamicflags = CIAO_EVENTS_HANDLERS_BUILD_DLL
+ macros += XML_USE_PTHREADS
+ requires += exceptions
+ includes += $(CIAO_ROOT)/tools/Config_Handlers
+ after += CIAO_XML_Utils
+ libs += CIAO_XML_Utils
+ includes += $(CIAO_ROOT)/ciao
+
+ Source_Files {
+ CIAOEvents.cpp
+ CIAOEvents_Handler.cpp
+ }
+
+ Header_Files {
+ }
+} \ No newline at end of file
diff --git a/TAO/CIAO/tools/Config_Handlers/CIAO_Events/CIAO_Events_Handlers_Export.h b/TAO/CIAO/tools/Config_Handlers/CIAO_Events/CIAO_Events_Handlers_Export.h
new file mode 100644
index 00000000000..efe95849905
--- /dev/null
+++ b/TAO/CIAO/tools/Config_Handlers/CIAO_Events/CIAO_Events_Handlers_Export.h
@@ -0,0 +1,54 @@
+
+// -*- C++ -*-
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl -n CIAO_Events_Handlers
+// ------------------------------
+#ifndef CIAO_EVENTS_HANDLERS_EXPORT_H
+#define CIAO_EVENTS_HANDLERS_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if !defined (CIAO_EVENTS_HANDLERS_HAS_DLL)
+# define CIAO_EVENTS_HANDLERS_HAS_DLL 1
+#endif /* ! CIAO_EVENTS_HANDLERS_HAS_DLL */
+
+#if defined (CIAO_EVENTS_HANDLERS_HAS_DLL) && (CIAO_EVENTS_HANDLERS_HAS_DLL == 1)
+# if defined (CIAO_EVENTS_HANDLERS_BUILD_DLL)
+# define CIAO_Events_Handlers_Export ACE_Proper_Export_Flag
+# define CIAO_EVENTS_HANDLERS_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define CIAO_EVENTS_HANDLERS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* CIAO_EVENTS_HANDLERS_BUILD_DLL */
+# define CIAO_Events_Handlers_Export ACE_Proper_Import_Flag
+# define CIAO_EVENTS_HANDLERS_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define CIAO_EVENTS_HANDLERS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* CIAO_EVENTS_HANDLERS_BUILD_DLL */
+#else /* CIAO_EVENTS_HANDLERS_HAS_DLL == 1 */
+# define CIAO_Events_Handlers_Export
+# define CIAO_EVENTS_HANDLERS_SINGLETON_DECLARATION(T)
+# define CIAO_EVENTS_HANDLERS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* CIAO_EVENTS_HANDLERS_HAS_DLL == 1 */
+
+// Set CIAO_EVENTS_HANDLERS_NTRACE = 0 to turn on library specific tracing even if
+// tracing is turned off for ACE.
+#if !defined (CIAO_EVENTS_HANDLERS_NTRACE)
+# if (ACE_NTRACE == 1)
+# define CIAO_EVENTS_HANDLERS_NTRACE 1
+# else /* (ACE_NTRACE == 1) */
+# define CIAO_EVENTS_HANDLERS_NTRACE 0
+# endif /* (ACE_NTRACE == 1) */
+#endif /* !CIAO_EVENTS_HANDLERS_NTRACE */
+
+#if (CIAO_EVENTS_HANDLERS_NTRACE == 1)
+# define CIAO_EVENTS_HANDLERS_TRACE(X)
+#else /* (CIAO_EVENTS_HANDLERS_NTRACE == 1) */
+# if !defined (ACE_HAS_TRACE)
+# define ACE_HAS_TRACE
+# endif /* ACE_HAS_TRACE */
+# define CIAO_EVENTS_HANDLERS_TRACE(X) ACE_TRACE_IMPL(X)
+# include "ace/Trace.h"
+#endif /* (CIAO_EVENTS_HANDLERS_NTRACE == 1) */
+
+#endif /* CIAO_EVENTS_HANDLERS_EXPORT_H */
+
+// End of auto generated file.