summaryrefslogtreecommitdiff
path: root/CIAO/ciaosvcs/Events/CIAO_Events_Base
diff options
context:
space:
mode:
Diffstat (limited to 'CIAO/ciaosvcs/Events/CIAO_Events_Base')
-rw-r--r--CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_EventServiceBase.cpp34
-rw-r--r--CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_EventServiceBase.h110
-rw-r--r--CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_Events.idl79
-rw-r--r--CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_Events_Base.mpc26
-rw-r--r--CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_Events_Export.h53
5 files changed, 302 insertions, 0 deletions
diff --git a/CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_EventServiceBase.cpp b/CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_EventServiceBase.cpp
new file mode 100644
index 00000000000..98a9eb38a2b
--- /dev/null
+++ b/CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_EventServiceBase.cpp
@@ -0,0 +1,34 @@
+//=============================================================================
+/**
+ * @file CIAO_EventServiceBase.cpp
+ *
+ * $Id$
+ *
+ * @author Gan Deng <dengg@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+#include "CIAO_EventServiceBase.h"
+
+namespace CIAO
+{
+ EventServiceBase::
+ EventServiceBase (void)
+ {
+ }
+
+ EventServiceBase::~EventServiceBase (void)
+ {
+ }
+
+ void
+ EventServiceBase::ciao_push_event (
+ ::Components::EventBase * evt,
+ const char * source_id,
+ ::CORBA::TypeCode_ptr tc)
+ {
+ ACE_UNUSED_ARG (evt);
+ ACE_UNUSED_ARG (source_id);
+ ACE_UNUSED_ARG (tc);
+ }
+}
diff --git a/CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_EventServiceBase.h b/CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_EventServiceBase.h
new file mode 100644
index 00000000000..062026bb3f0
--- /dev/null
+++ b/CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_EventServiceBase.h
@@ -0,0 +1,110 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file CIAO_EventServiceBase.h
+ *
+ * $Id$
+ *
+ * @author Gan Deng <dengg@dre.vanderbilt.edu>
+ * @author George Edwards <g.edwards@vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef CIAO_EVENTSERVICEBASE_H
+#define CIAO_EVENTSERVICEBASE_H
+#include /**/ "ace/pre.h"
+
+#include "CIAO_EventsS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+namespace CIAO
+{
+ /**
+ * @class EventServiceBase
+ *
+ * An abstract base servant class to implement the CIAO_Event_Service
+ * interface. The derived classes will provide appropriate
+ * implementations of the connect, disconnect, and push methods depending on
+ * the event mechanism used.
+ */
+ class CIAO_EVENTS_Export EventServiceBase :
+ public virtual POA_CIAO::CIAO_Event_Service
+ {
+ public:
+ EventServiceBase (void);
+
+ virtual ~EventServiceBase (void);
+
+ /// A factory method for Supplier_Config objects
+ virtual Supplier_Config_ptr create_supplier_config (void) = 0;
+
+ /// A factory method for Consumer_Config objects
+ virtual Consumer_Config_ptr create_consumer_config (void) = 0;
+
+ /**
+ * @fn void connect_event_supplier (Supplier_Config_ptr supplier_config)
+ *
+ * Connects an event supplier using the options specified by
+ * @c supplier_config.
+ */
+ virtual void connect_event_supplier (Supplier_Config_ptr supplier_config) = 0;
+
+ /**
+ * @fn void connect_event_consumer (Consumer_Config_ptr consumer_config)
+ *
+ * Connects an event consumer using the options specified by
+ * @c consumer_config.
+ */
+ virtual void connect_event_consumer (Consumer_Config_ptr consumer_config) = 0;
+
+ /**
+ * @fn void disconnect_event_supplier ()
+ *
+ * Disconnects the event supplier associated with this object.
+ */
+ virtual void disconnect_event_supplier (const char * consumer_id) = 0;
+
+ /**
+ * @fn void disconnect_event_consumer (CONNECTION_ID consumer_id)
+ *
+ * Disconnects the event consumer with UUID @c consumer_id.
+ */
+ virtual void disconnect_event_consumer (const char * consumer_id) = 0;
+
+ /**
+ * @fn void push_event (Components::EventBase * ev)
+ *
+ * Pushes event @c ev to all consumers.
+ */
+ virtual void push_event (Components::EventBase * ev) = 0;
+
+ /**
+ * Pushes event @c ev to all consumers. The source id of the
+ * supplier is specified through @c source_id.
+ */
+ virtual void ciao_push_event (
+ ::Components::EventBase * evt,
+ const char * source_id,
+ ::CORBA::TypeCode_ptr tc);
+ };
+
+ class Event_Consumer_Config_Base :
+ public virtual POA_CIAO::Consumer_Config
+ {
+ public:
+ virtual void start_conjunction_group (::CORBA::Long size) = 0;
+
+ virtual void start_disjunction_group (::CORBA::Long size) = 0;
+
+ virtual void insert_source (const char * source_id) = 0;
+
+ virtual void insert_type (::CORBA::Long event_type) = 0;
+ };
+}
+
+#include /**/ "ace/post.h"
+#endif /* CIAO_EVENTSERVICEBASE_H */
diff --git a/CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_Events.idl b/CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_Events.idl
new file mode 100644
index 00000000000..266f8b472e9
--- /dev/null
+++ b/CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_Events.idl
@@ -0,0 +1,79 @@
+// $Id$
+
+/**
+ * @file CIAO_Events.idl
+ *
+ * @author George Edwards <g.edwards@vanderbilt.edu>
+ * @author Gan Deng <dengg@dre.vanderbilt.edu>
+ *
+ * @brief Interfaces for configuring CIAO's event mechanism.
+ */
+
+#if !defined (CIAO_EVENTS_IDL)
+#define CIAO_EVENTS_IDL
+
+#include "ciao/CCM_EventConsumerBase.idl"
+#include "ciao/CCM_Base.idl"
+
+module CIAO
+{
+ /// A component's UUID + port name.
+ typedef string CONNECTION_ID;
+
+ enum EventServiceType
+ {
+ EC,
+ RTEC,
+ NOTIFY,
+ RTNOTIFY
+ };
+
+ interface Supplier_Config
+ {
+ attribute CONNECTION_ID supplier_id;
+
+ readonly attribute EventServiceType service_type;
+
+ void destroy ();
+ };
+
+ interface Consumer_Config
+ {
+ attribute CONNECTION_ID consumer_id;
+
+ readonly attribute EventServiceType service_type;
+
+ attribute Components::EventConsumerBase consumer;
+
+ void start_conjunction_group (in long size);
+
+ void start_disjunction_group (in long size);
+
+ void insert_source (in CONNECTION_ID source_id);
+
+ void insert_type (in long event_type);
+
+ void destroy ();
+ };
+
+ interface CIAO_Event_Service : Components::EventConsumerBase
+ {
+ Supplier_Config create_supplier_config ();
+
+ Consumer_Config create_consumer_config ();
+
+ void connect_event_supplier (in Supplier_Config supplier_conf);
+
+ void connect_event_consumer (in Consumer_Config consumer_conf);
+
+ void disconnect_event_supplier (in CONNECTION_ID conn_id)
+ raises (Components::InvalidConnection);
+
+ void disconnect_event_consumer (in CONNECTION_ID conn_id)
+ raises (Components::InvalidConnection);
+
+ //void push_event (in Components::EventBase ev);
+ };
+};
+
+#endif /* CIAO_EVENTS_IDL */
diff --git a/CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_Events_Base.mpc b/CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_Events_Base.mpc
new file mode 100644
index 00000000000..e7602e2e0ac
--- /dev/null
+++ b/CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_Events_Base.mpc
@@ -0,0 +1,26 @@
+// -*- MPC -*-
+// $Id$
+
+
+project (CIAO_Events_Base) : orbsvcslib, ciao_client_dnc, ciao_container_dnc {
+
+ sharedname = CIAO_Events_Base
+ idlflags += -Wb,export_include=CIAO_Events_Export.h -Wb,export_macro=CIAO_EVENTS_Export
+ dynamicflags = CIAO_EVENTS_BUILD_DLL
+
+ IDL_Files {
+ CIAO_Events.idl
+ }
+
+ Source_Files {
+ CIAO_EventServiceBase.cpp
+ CIAO_EventsC.cpp
+ CIAO_EventsS.cpp
+ }
+
+ Header_Files {
+ CIAO_EventsC.h
+ CIAO_EventsS.h
+ CIAO_EventServiceBase.h
+ }
+}
diff --git a/CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_Events_Export.h b/CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_Events_Export.h
new file mode 100644
index 00000000000..6678cef4bcc
--- /dev/null
+++ b/CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_Events_Export.h
@@ -0,0 +1,53 @@
+// -*- C++ -*-
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl CIAO_EVENTS
+// ------------------------------
+#ifndef CIAO_EVENTS_EXPORT_H
+#define CIAO_EVENTS_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if !defined (CIAO_EVENTS_HAS_DLL)
+# define CIAO_EVENTS_HAS_DLL 1
+#endif /* ! CIAO_EVENTS_HAS_DLL */
+
+#if defined (CIAO_EVENTS_HAS_DLL) && (CIAO_EVENTS_HAS_DLL == 1)
+# if defined (CIAO_EVENTS_BUILD_DLL)
+# define CIAO_EVENTS_Export ACE_Proper_Export_Flag
+# define CIAO_EVENTS_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define CIAO_EVENTS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* CIAO_EVENTS_BUILD_DLL */
+# define CIAO_EVENTS_Export ACE_Proper_Import_Flag
+# define CIAO_EVENTS_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define CIAO_EVENTS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* CIAO_EVENTS_BUILD_DLL */
+#else /* CIAO_EVENTS_HAS_DLL == 1 */
+# define CIAO_EVENTS_Export
+# define CIAO_EVENTS_SINGLETON_DECLARATION(T)
+# define CIAO_EVENTS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* CIAO_EVENTS_HAS_DLL == 1 */
+
+// Set CIAO_EVENTS_NTRACE = 0 to turn on library specific tracing even if
+// tracing is turned off for ACE.
+#if !defined (CIAO_EVENTS_NTRACE)
+# if (ACE_NTRACE == 1)
+# define CIAO_EVENTS_NTRACE 1
+# else /* (ACE_NTRACE == 1) */
+# define CIAO_EVENTS_NTRACE 0
+# endif /* (ACE_NTRACE == 1) */
+#endif /* !CIAO_EVENTS_NTRACE */
+
+#if (CIAO_EVENTS_NTRACE == 1)
+# define CIAO_EVENTS_TRACE(X)
+#else /* (CIAO_EVENTS_NTRACE == 1) */
+# if !defined (ACE_HAS_TRACE)
+# define ACE_HAS_TRACE
+# endif /* ACE_HAS_TRACE */
+# define CIAO_EVENTS_TRACE(X) ACE_TRACE_IMPL(X)
+# include "ace/Trace.h"
+#endif /* (CIAO_EVENTS_NTRACE == 1) */
+
+#endif /* CIAO_EVENTS_EXPORT_H */
+
+// End of auto generated file.