diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-07-08 00:31:25 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-07-08 00:31:25 +0000 |
commit | 5f9ec9206a3804a58756f5fd38ae593d0dc0991c (patch) | |
tree | 1e1b841af7a4d63109e2a80f92418b216988ca48 /TAO/tao | |
parent | e91028d046011c7097d1c8ed16365b1931589e8e (diff) | |
download | ATCD-5f9ec9206a3804a58756f5fd38ae593d0dc0991c.tar.gz |
ChangeLogTag:Wed Jul 7 19:24:00 1999 Carlos O'Ryan <coryan@cs.wustl.edu>
Diffstat (limited to 'TAO/tao')
-rw-r--r-- | TAO/tao/Makefile | 3 | ||||
-rw-r--r-- | TAO/tao/default_resource.cpp | 16 | ||||
-rw-r--r-- | TAO/tao/default_resource.h | 3 | ||||
-rw-r--r-- | TAO/tao/xt_resource.cpp | 42 | ||||
-rw-r--r-- | TAO/tao/xt_resource.h | 68 | ||||
-rw-r--r-- | TAO/tao/xt_resource.i | 6 |
6 files changed, 119 insertions, 19 deletions
diff --git a/TAO/tao/Makefile b/TAO/tao/Makefile index ee7177cb8e3..db7bf753b64 100644 --- a/TAO/tao/Makefile +++ b/TAO/tao/Makefile @@ -75,7 +75,8 @@ PLUGGABLE_PROTOCOLS_FILES = \ DEFAULT_RESOURCES_FILES = \ default_client \ default_server \ - default_resource + default_resource \ + xt_resource INTERPRETIVE_MARSHALING_FILES = \ append \ diff --git a/TAO/tao/default_resource.cpp b/TAO/tao/default_resource.cpp index adf7a67e1ae..433ac742f64 100644 --- a/TAO/tao/default_resource.cpp +++ b/TAO/tao/default_resource.cpp @@ -11,7 +11,6 @@ #include "tao/Connector_Registry.h" #include "ace/Select_Reactor.h" -#include "ace/XtReactor.h" #include "ace/FlReactor.h" #include "ace/WFMO_Reactor.h" #include "ace/Msg_WFMO_Reactor.h" @@ -111,15 +110,6 @@ TAO_Default_Resource_Factory::init (int argc, char **argv) " not supported on this platform\n")); #endif /* ACE_HAS_FL */ else if (ACE_OS::strcasecmp (name, - "xt") == 0) -#if defined(ACE_HAS_XT) - reactor_type_ = TAO_REACTOR_XT; -#else - ACE_DEBUG ((LM_DEBUG, - "TAO_Default_Factory - XtReactor" - " not supported on this platform\n")); -#endif /* ACE_HAS_XT */ - else if (ACE_OS::strcasecmp (name, "wfmo") == 0) #if defined(ACE_WIN32) reactor_type_ = TAO_REACTOR_WFMO; @@ -358,12 +348,6 @@ TAO_Default_Resource_Factory::allocate_reactor_impl (void) const #endif /* ACE_HAS_FL */ break; - case TAO_REACTOR_XT: -#if defined(ACE_HAS_XT) - ACE_NEW_RETURN (impl, ACE_XtReactor, 0); -#endif /* ACE_HAS_FL */ - break; - case TAO_REACTOR_WFMO: #if defined(ACE_WIN32) && !defined (ACE_HAS_WINCE) ACE_NEW_RETURN (impl, ACE_WFMO_Reactor, 0); diff --git a/TAO/tao/default_resource.h b/TAO/tao/default_resource.h index 1f732a22131..551311386e1 100644 --- a/TAO/tao/default_resource.h +++ b/TAO/tao/default_resource.h @@ -70,7 +70,6 @@ public: TAO_REACTOR_SELECT_MT, // Use ACE_Token TAO_REACTOR_SELECT_ST, // Use ACE_Noop_Token TAO_REACTOR_FL, - TAO_REACTOR_XT, TAO_REACTOR_WFMO, TAO_REACTOR_MSGWFMO, TAO_REACTOR_TP @@ -93,7 +92,7 @@ public: virtual int init_protocol_factories (void); protected: - ACE_Reactor_Impl *allocate_reactor_impl (void) const; + virtual ACE_Reactor_Impl *allocate_reactor_impl (void) const; // Obtain the reactor implementation protected: diff --git a/TAO/tao/xt_resource.cpp b/TAO/tao/xt_resource.cpp new file mode 100644 index 00000000000..f6204af62d2 --- /dev/null +++ b/TAO/tao/xt_resource.cpp @@ -0,0 +1,42 @@ +// $Id$ + +#include "tao/xt_resource.h" + +#if defined(ACE_HAS_XT) + +#if !defined (__ACE_INLINE__) +# include "tao/xt_resource.i" +#endif /* ! __ACE_INLINE__ */ + +ACE_RCSID(tao, xt_resource, "$Id$") + +XtAppContext +TAO_XT_Resource_Factory::context_ = 0; + +ACE_Reactor_Impl* +TAO_XT_Resource_Factory::allocate_reactor_impl (void) const +{ + if (TAO_XT_Resource_Factory::context_ == 0) + return 0; + + ACE_Reactor_Impl *impl = 0; + + ACE_NEW_RETURN (impl, ACE_XtReactor (TAO_XT_Resource_Factory::context_), 0); + return impl; +} + +void +TAO_XT_Resource_Factory::set_context (XtAppContext context) +{ + TAO_XT_Resource_Factory::context_ = context; +} + +ACE_STATIC_SVC_DEFINE (TAO_XT_Resource_Factory, + ASYS_TEXT ("XT_Resource_Factory"), + ACE_SVC_OBJ_T, + &ACE_SVC_NAME (TAO_XT_Resource_Factory), + ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, + 0) +ACE_FACTORY_DEFINE (TAO, TAO_XT_Resource_Factory) + +#endif /* ACE_HAS_XT */ diff --git a/TAO/tao/xt_resource.h b/TAO/tao/xt_resource.h new file mode 100644 index 00000000000..f65ebb2c8cf --- /dev/null +++ b/TAO/tao/xt_resource.h @@ -0,0 +1,68 @@ +// -*- C++ -*- +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// TAO +// +// = FILENAME +// xt_resource.h +// +// = AUTHOR +// Carlos O'Ryan +// +// ============================================================================ + +#ifndef TAO_XT_RESOURCE_H +#define TAO_XT_RESOURCE_H + +#include "tao/default_resource.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if defined (ACE_HAS_XT) + +#include "ace/XtReactor.h" + +// **************************************************************** + +class TAO_XT_Resource_Factory : public TAO_Default_Resource_Factory +{ + // = TITLE + // TAO's default resource factory + // + // = DESCRIPTION + // Using a <{resource source specifier}> as a discriminator, the + // factory can return resource instances which are, e.g., global, + // stored in thread-specific storage, stored in shared memory, + // etc. + // +public: + // = Initialization and termination methods. + TAO_XT_Resource_Factory (void); + // Constructor. + + static void set_context (XtAppContext context); + // Set the context used to create the XtReactor + +protected: + virtual ACE_Reactor_Impl *allocate_reactor_impl (void) const; + // Obtain the reactor implementation + +private: + static XtAppContext context_; +}; + +#if defined (__ACE_INLINE__) +#include "tao/xt_resource.i" +#endif /* __ACE_INLINE__ */ + +ACE_STATIC_SVC_DECLARE (TAO_XT_Resource_Factory) +ACE_FACTORY_DECLARE (TAO, TAO_XT_Resource_Factory) + +#endif /* ACE_HAS_XT */ + +#endif /* TAO_DEFAULT_CLIENT_H */ diff --git a/TAO/tao/xt_resource.i b/TAO/tao/xt_resource.i new file mode 100644 index 00000000000..0b14c74dcf9 --- /dev/null +++ b/TAO/tao/xt_resource.i @@ -0,0 +1,6 @@ +// $Id$ + +ACE_INLINE +TAO_XT_Resource_Factory::TAO_XT_Resource_Factory (void) +{ +} |