diff options
Diffstat (limited to 'TAO/CIAO/examples/BasicSP/EC')
-rw-r--r-- | TAO/CIAO/examples/BasicSP/EC/EC.cidl | 21 | ||||
-rw-r--r-- | TAO/CIAO/examples/BasicSP/EC/EC.idl | 41 | ||||
-rw-r--r-- | TAO/CIAO/examples/BasicSP/EC/EC.mpc | 108 | ||||
-rw-r--r-- | TAO/CIAO/examples/BasicSP/EC/ECEI.idl | 32 | ||||
-rw-r--r-- | TAO/CIAO/examples/BasicSP/EC/EC_exec.cpp | 301 | ||||
-rw-r--r-- | TAO/CIAO/examples/BasicSP/EC/EC_exec.h | 190 | ||||
-rw-r--r-- | TAO/CIAO/examples/BasicSP/EC/EC_exec_export.h | 58 | ||||
-rw-r--r-- | TAO/CIAO/examples/BasicSP/EC/EC_stub_export.h | 58 | ||||
-rw-r--r-- | TAO/CIAO/examples/BasicSP/EC/EC_svnt_export.h | 58 | ||||
-rw-r--r-- | TAO/CIAO/examples/BasicSP/EC/README | 9 | ||||
-rw-r--r-- | TAO/CIAO/examples/BasicSP/EC/client.cpp | 77 | ||||
-rw-r--r-- | TAO/CIAO/examples/BasicSP/EC/controller.cpp | 143 |
12 files changed, 0 insertions, 1096 deletions
diff --git a/TAO/CIAO/examples/BasicSP/EC/EC.cidl b/TAO/CIAO/examples/BasicSP/EC/EC.cidl deleted file mode 100644 index 8e9ff0d5575..00000000000 --- a/TAO/CIAO/examples/BasicSP/EC/EC.cidl +++ /dev/null @@ -1,21 +0,0 @@ -//$Id$ - -#ifndef EC_CIDL -#define EC_CIDL - -#include "EC.idl" - -composition session EC_Impl -{ - home executor ECHome_Exec - { - implements BasicSP::ECHome; - manages EC_Exec; - }; -}; - -#endif /* EC_CIDL */ - - - - diff --git a/TAO/CIAO/examples/BasicSP/EC/EC.idl b/TAO/CIAO/examples/BasicSP/EC/EC.idl deleted file mode 100644 index 50ad25afd7f..00000000000 --- a/TAO/CIAO/examples/BasicSP/EC/EC.idl +++ /dev/null @@ -1,41 +0,0 @@ -// $Id$ -//============================================================================= -/** - * @file EC.idl - * - * Definition of events, and common interfaces used in the BasicSP module. - * - * @author Balachandran Natarajan <bala@dre.vanderbilt.edu> - */ -//============================================================================= - -#ifndef CIAO_EC_IDL -#define CIAO_EC_IDL - -#include "../BasicSP.idl" - -module BasicSP -{ - interface trigger - { - void start (); - void stop (); - }; - component EC supports trigger - { - publishes TimeOut timeout; - - /// The attribute can be configured via the home or the - /// component property file. - attribute long hertz; - - }; - - home ECHome manages EC - { - // Explicit operations - factory new_EC (in long hertz); - }; -}; - -#endif /* CIAO_EC_IDL*/ diff --git a/TAO/CIAO/examples/BasicSP/EC/EC.mpc b/TAO/CIAO/examples/BasicSP/EC/EC.mpc deleted file mode 100644 index c850d19e968..00000000000 --- a/TAO/CIAO/examples/BasicSP/EC/EC.mpc +++ /dev/null @@ -1,108 +0,0 @@ -// $Id$ -// This file is generated with "generate_component_mpc.pl -l .. -p BasicSP -i -c EC" - -project(EC_DnC_stub): ciao_client_dnc { - after += BasicSP_DnC_stub - - sharedname = EC_stub - - idlflags += -Wb,stub_export_macro=EC_STUB_Export - idlflags += -Wb,stub_export_include=EC_stub_export.h - idlflags += -Wb,skel_export_macro=EC_SVNT_Export - idlflags += -Wb,skel_export_include=EC_svnt_export.h - - dynamicflags = EC_STUB_BUILD_DLL - - libs += BasicSP_stub - - IDL_Files { - EC.idl - } - - Source_Files { - ECC.cpp - } -} - -project(EC_DnC_svnt) : ciao_servant_dnc { - after += BasicSP_DnC_svnt EC_DnC_stub - sharedname = EC_svnt - - libpaths += .. - - idlflags += -Wb,export_macro=EC_SVNT_Export - idlflags += -Wb,export_include=EC_svnt_export.h - - dynamicflags = EC_SVNT_BUILD_DLL - - libs += EC_stub BasicSP_stub BasicSP_svnt - - CIDL_Files { - EC.cidl - } - - IDL_Files { - ECE.idl - } - - Source_Files { - ECEC.cpp - ECS.cpp - EC_svnt.cpp - } -} - - -project(EC_DnC_exec) : ciao_component_dnc { - after += EC_DnC_svnt - sharedname = EC_exec - - libs += EC_stub BasicSP_stub BasicSP_svnt EC_svnt - - libpaths += .. - - idlflags += -Wb,export_macro=EC_EXEC_Export - idlflags += -Wb,export_include=EC_exec_export.h - - dynamicflags = EC_EXEC_BUILD_DLL - - IDL_Files { - ECEI.idl - } - - Source_Files { - ECEIC.cpp - EC_exec.cpp - } -} - - - -project (EC_DnC_client) : ciao_client_dnc, valuetype { - exename = client - after += EC_DnC_stub - libs += EC_stub BasicSP_stub - libpaths += .. - - IDL_Files { - } - - Source_Files { - client.cpp - } -} - - -project (EC_DnC_controller) : ciao_client_dnc, valuetype { - exename = controller - after += EC_DnC_stub - libs += EC_stub BasicSP_stub - libpaths += .. - - IDL_Files { - } - - Source_Files { - controller.cpp - } -} diff --git a/TAO/CIAO/examples/BasicSP/EC/ECEI.idl b/TAO/CIAO/examples/BasicSP/EC/ECEI.idl deleted file mode 100644 index 9b48d5c74dd..00000000000 --- a/TAO/CIAO/examples/BasicSP/EC/ECEI.idl +++ /dev/null @@ -1,32 +0,0 @@ -// $Id$ - -//============================================================================= -/** - * @file ECEI.idl - * - * - * @author Balachandran Natarajan <bala@dre.vanderbilt.edu> - */ -//============================================================================= -#ifndef CIAO_ECEI_IDL -#define CIAO_ECEI_IDL - -#include "ECE.idl" - -module BasicSP -{ - /** - * @interface EC_Exec - * - * The actually EC executor need to support - * Components::SessionComponent interface. Therefore, we need to - * define the component executor interface explicitly here. - */ - local interface EC_Exec : CCM_EC, - Components::SessionComponent - { - }; - -}; - -#endif /* RATEGENEI_IDL */ diff --git a/TAO/CIAO/examples/BasicSP/EC/EC_exec.cpp b/TAO/CIAO/examples/BasicSP/EC/EC_exec.cpp deleted file mode 100644 index e7de45b3b46..00000000000 --- a/TAO/CIAO/examples/BasicSP/EC/EC_exec.cpp +++ /dev/null @@ -1,301 +0,0 @@ -// $Id$ - -#include "EC_exec.h" -#include "CIAO_common.h" -#include "ace/Timer_Queue.h" -#include "ace/Reactor.h" - -//================================================================= - -MyImpl::timeout_Handler::timeout_Handler (MyImpl::EC_exec_i *cb) - : active_ (0), - done_ (0), - tid_ (0), - pulse_callback_ (cb) -{ - // Nothing - this->reactor (new ACE_Reactor); -} - -MyImpl::timeout_Handler::~timeout_Handler () -{ - delete this->reactor (); - this->reactor (0); -} - -int -MyImpl::timeout_Handler::open_h () -{ - return this->activate (); -} - -int -MyImpl::timeout_Handler::close_h () -{ - this->done_ = 1; - this->reactor ()->notify (); - - if (CIAO::debug_level () > 0) - ACE_DEBUG ((LM_DEBUG, "Waiting\n")); - return this->wait (); -} - -int -MyImpl::timeout_Handler::start (CORBA::Long hertz) -{ - if (hertz == 0 || this->active_ != 0) // Not valid - return -1; - - long usec = 1000000 / hertz; - - this->tid_ = this->reactor ()->schedule_timer (this, - 0, - ACE_Time_Value (0, usec), - ACE_Time_Value (0, usec)); - - this->active_ = 1; - return 0; -} - -int -MyImpl::timeout_Handler::stop (void) -{ - if (this->active_ == 0) // Not valid. - return -1; - - this->reactor ()->cancel_timer (this); - - this->active_ = 0; - return 0; -} - -int -MyImpl::timeout_Handler::active (void) -{ - return this->active_; -} - -int -MyImpl::timeout_Handler::handle_close (ACE_HANDLE handle, - ACE_Reactor_Mask close_mask) -{ - if (CIAO::debug_level () > 0) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("[%x] handle = %d, close_mask = %d\n"), - this, - handle, - close_mask)); - - return 0; -} - -int -MyImpl::timeout_Handler::handle_timeout (const ACE_Time_Value &, - const void *) -{ - this->pulse_callback_->pulse (); - -// ACE_DEBUG ((LM_DEBUG, -// ACE_TEXT ("[%x] with count #%05d timed out at %d.%d!\n"), -// this, -// tv.sec (), -// tv.usec ())); - - return 0; -} - -int -MyImpl::timeout_Handler::svc (void) -{ - this->reactor ()->owner (ACE_OS::thr_self ()); - - while (!this->done_) - this->reactor ()->handle_events (); - - return 0; -} - -//================================================================= - -MyImpl::EC_exec_i::EC_exec_i () - : hertz_ (0), - pulser_ (this) -{ - -} - -MyImpl::EC_exec_i::EC_exec_i (CORBA::Long hz) - : hertz_ (hz), - pulser_ (this) -{ -} - -MyImpl::EC_exec_i::~EC_exec_i () -{ -} - -CORBA::Long -MyImpl::EC_exec_i::hertz (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return this->hertz_; -} - -void -MyImpl::EC_exec_i::hertz (CORBA::Long hertz - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - this->hertz_ = hertz; -} - -// Operations from supported interface(s) - -void -MyImpl::EC_exec_i::start (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - if (this->hertz_ == 0 || this->pulser_.active()) - ACE_THROW (CORBA::BAD_INV_ORDER ()); - - // @@ Start the rate generator - this->pulser_.start (this->hertz_); -} - -void -MyImpl::EC_exec_i::stop (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - if (! this->pulser_.active ()) - ACE_THROW (CORBA::BAD_INV_ORDER ()); - - // @@ stop the rate generator - this->pulser_.stop (); -} - -CORBA::Boolean -MyImpl::EC_exec_i::active (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return this->pulser_.active (); -} - -// Operations from Components::SessionComponent - -void -MyImpl::EC_exec_i::set_session_context (Components::SessionContext_ptr ctx - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::CCMException)) -{ - if (CIAO::debug_level () > 0) - ACE_DEBUG ((LM_DEBUG, "MyImpl::EC_exec_i::set_session_context\n")); - - this->context_ = - BasicSP::CCM_EC_Context::_narrow (ctx - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - if (CORBA::is_nil (this->context_.in ())) - ACE_THROW (CORBA::INTERNAL ()); - // Urm, we actually discard exceptions thown from this operation. - -} - -void -MyImpl::EC_exec_i::ciao_preactivate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::CCMException)) -{ -} - -void -MyImpl::EC_exec_i::ccm_activate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::CCMException)) -{ - if (CIAO::debug_level () > 0) - ACE_DEBUG ((LM_DEBUG, "MyImpl::EC_exec_i::ccm_activate\n")); - - this->pulser_.open_h (); -} - -void -MyImpl::EC_exec_i::ciao_postactivate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::CCMException)) -{ -} - -void -MyImpl::EC_exec_i::ccm_passivate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::CCMException)) -{ - if (CIAO::debug_level () > 0) - ACE_DEBUG ((LM_DEBUG, "MyImpl::EC_exec_i::ccm_passivate\n")); - this->pulser_.close_h (); -} - -void -MyImpl::EC_exec_i::ccm_remove (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::CCMException)) -{ - if (CIAO::debug_level () > 0) - ACE_DEBUG ((LM_DEBUG, "MyImpl::EC_exec_i::ccm_remove\n")); -} - -void -MyImpl::EC_exec_i::pulse (void) -{ - ACE_TRY_NEW_ENV - { - if (CIAO::debug_level () > 0) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("Pushing BasicSP::TimeOut event!\n"))); - - BasicSP::TimeOut_var ev = new OBV_BasicSP::TimeOut (); - - this->context_->push_timeout (ev.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - // @@ do nothing? - } - ACE_ENDTRY; - -} - -MyImpl::ECHome_exec_i::ECHome_exec_i () -{ -} - -MyImpl::ECHome_exec_i::~ECHome_exec_i () -{ -} - -::Components::EnterpriseComponent_ptr -MyImpl::ECHome_exec_i::new_EC (CORBA::Long hertz - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return new MyImpl::EC_exec_i (hertz); -} - -::Components::EnterpriseComponent_ptr -MyImpl::ECHome_exec_i::create (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::CCMException)) -{ - return new MyImpl::EC_exec_i (); -} - - -extern "C" EC_EXEC_Export ::Components::HomeExecutorBase_ptr -createECHome_Impl (void) -{ - return new MyImpl::ECHome_exec_i (); -} diff --git a/TAO/CIAO/examples/BasicSP/EC/EC_exec.h b/TAO/CIAO/examples/BasicSP/EC/EC_exec.h deleted file mode 100644 index db95a5deaa4..00000000000 --- a/TAO/CIAO/examples/BasicSP/EC/EC_exec.h +++ /dev/null @@ -1,190 +0,0 @@ -// $Id$ - -//============================================================ -/** - * @file EC_exec.h - * - * Header file for the actualy EC and ECHome component - * implementation. - * - * @author Balachandran Natarajan <bala@dre.vanderbilt.edu> - */ -//============================================================ - -#ifndef EC_EXEC_H -#define EC_EXEC_H - -#include "ECEIC.h" -#include "tao/LocalObject.h" -#include "ace/Thread_Manager.h" -#include "ace/Task.h" - -namespace MyImpl -{ - // Forward decl. - class EC_exec_i; - - /** - * @brief Active pulse generater - */ - class timeout_Handler : public ACE_Task_Base - { - public: - // Default constructor - timeout_Handler (EC_exec_i *cb); - ~timeout_Handler (); - - int open_h (void); - - int close_h (void); - - int start (CORBA::Long hertz); - - int stop (void); - - int active (void); - - // Handle the timeout. - virtual int handle_timeout (const ACE_Time_Value &tv, - const void *arg); - - // Called when <Time_Handler> is removed. - virtual int handle_close (ACE_HANDLE handle, - ACE_Reactor_Mask close_mask); - - virtual int svc (void); - - private: - /// Tracking whether we are actively generating pulse or not. - long active_; - - /// Flag to indicate completion of this active object. - int done_; - - /// The timer id we are waiting. - long tid_; - - EC_exec_i *pulse_callback_; - - ACE_Thread_Manager thr_mgr_; - }; - - /** - * @class EC_exec_i - * - * EC executor implementation class. - */ - class EC_EXEC_Export EC_exec_i : - public virtual BasicSP::EC_Exec, - public virtual TAO_Local_RefCounted_Object - { - public: - /// Default constructor. - EC_exec_i (); - - /// Initialize with a default frequency. - EC_exec_i (CORBA::Long hz); - - /// Default destructor. - ~EC_exec_i (); - - // Attribute operations. - - virtual CORBA::Long hertz (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void hertz (CORBA::Long hertz - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - // Operations from supported interface(s) - - virtual void start (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void stop (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual CORBA::Boolean active (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - // Operations from Components::SessionComponent - - virtual void set_session_context (Components::SessionContext_ptr ctx - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::CCMException)); - - virtual void ciao_preactivate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::CCMException)); - - virtual void ccm_activate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::CCMException)); - - virtual void ciao_postactivate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::CCMException)); - - - virtual void ccm_passivate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::CCMException)); - - virtual void ccm_remove (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::CCMException)); - - /// Helper function to be called back by timeout_Handler - void pulse (void); - - protected: - /// Frequency - CORBA::Long hertz_; - - /// Copmponent specific context - BasicSP::CCM_EC_Context_var context_; - - /// An active object that actually trigger the generation of - /// periodic events. - timeout_Handler pulser_; - }; - - /** - * @class ECHome_exec_i - * - * EC home executor implementation class. - */ - class EC_EXEC_Export ECHome_exec_i : - public virtual BasicSP::CCM_ECHome, - public virtual TAO_Local_RefCounted_Object - { - public: - /// Default ctor. - ECHome_exec_i (); - - /// Default dtor. - ~ECHome_exec_i (); - - // Explicit home operations. - - virtual ::Components::EnterpriseComponent_ptr - new_EC (CORBA::Long hertz - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - // Implicit home operations. - - virtual ::Components::EnterpriseComponent_ptr - create (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::CCMException)); - }; - -} - -extern "C" EC_EXEC_Export ::Components::HomeExecutorBase_ptr -createECHome_Impl (void); - -#endif /* CIAO_ECGEN_EXEC_H */ diff --git a/TAO/CIAO/examples/BasicSP/EC/EC_exec_export.h b/TAO/CIAO/examples/BasicSP/EC/EC_exec_export.h deleted file mode 100644 index 6a2d911d430..00000000000 --- a/TAO/CIAO/examples/BasicSP/EC/EC_exec_export.h +++ /dev/null @@ -1,58 +0,0 @@ - -// -*- C++ -*- -// $Id$ -// Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl -s EC_EXEC -// ------------------------------ -#ifndef EC_EXEC_EXPORT_H -#define EC_EXEC_EXPORT_H - -#include "ace/config-all.h" - -#if defined (ACE_AS_STATIC_LIBS) && !defined (EC_EXEC_HAS_DLL) -# define EC_EXEC_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && EC_EXEC_HAS_DLL */ - -#if !defined (EC_EXEC_HAS_DLL) -# define EC_EXEC_HAS_DLL 1 -#endif /* ! EC_EXEC_HAS_DLL */ - -#if defined (EC_EXEC_HAS_DLL) && (EC_EXEC_HAS_DLL == 1) -# if defined (EC_EXEC_BUILD_DLL) -# define EC_EXEC_Export ACE_Proper_Export_Flag -# define EC_EXEC_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define EC_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else /* EC_EXEC_BUILD_DLL */ -# define EC_EXEC_Export ACE_Proper_Import_Flag -# define EC_EXEC_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define EC_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* EC_EXEC_BUILD_DLL */ -#else /* EC_EXEC_HAS_DLL == 1 */ -# define EC_EXEC_Export -# define EC_EXEC_SINGLETON_DECLARATION(T) -# define EC_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* EC_EXEC_HAS_DLL == 1 */ - -// Set EC_EXEC_NTRACE = 0 to turn on library specific tracing even if -// tracing is turned off for ACE. -#if !defined (EC_EXEC_NTRACE) -# if (ACE_NTRACE == 1) -# define EC_EXEC_NTRACE 1 -# else /* (ACE_NTRACE == 1) */ -# define EC_EXEC_NTRACE 0 -# endif /* (ACE_NTRACE == 1) */ -#endif /* !EC_EXEC_NTRACE */ - -#if (EC_EXEC_NTRACE == 1) -# define EC_EXEC_TRACE(X) -#else /* (EC_EXEC_NTRACE == 1) */ -# if !defined (ACE_HAS_TRACE) -# define ACE_HAS_TRACE -# endif /* ACE_HAS_TRACE */ -# define EC_EXEC_TRACE(X) ACE_TRACE_IMPL(X) -# include "ace/Trace.h" -#endif /* (EC_EXEC_NTRACE == 1) */ - -#endif /* EC_EXEC_EXPORT_H */ - -// End of auto generated file. diff --git a/TAO/CIAO/examples/BasicSP/EC/EC_stub_export.h b/TAO/CIAO/examples/BasicSP/EC/EC_stub_export.h deleted file mode 100644 index cce0970deae..00000000000 --- a/TAO/CIAO/examples/BasicSP/EC/EC_stub_export.h +++ /dev/null @@ -1,58 +0,0 @@ - -// -*- C++ -*- -// $Id$ -// Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl -s EC_STUB -// ------------------------------ -#ifndef EC_STUB_EXPORT_H -#define EC_STUB_EXPORT_H - -#include "ace/config-all.h" - -#if defined (ACE_AS_STATIC_LIBS) && !defined (EC_STUB_HAS_DLL) -# define EC_STUB_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && EC_STUB_HAS_DLL */ - -#if !defined (EC_STUB_HAS_DLL) -# define EC_STUB_HAS_DLL 1 -#endif /* ! EC_STUB_HAS_DLL */ - -#if defined (EC_STUB_HAS_DLL) && (EC_STUB_HAS_DLL == 1) -# if defined (EC_STUB_BUILD_DLL) -# define EC_STUB_Export ACE_Proper_Export_Flag -# define EC_STUB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define EC_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else /* EC_STUB_BUILD_DLL */ -# define EC_STUB_Export ACE_Proper_Import_Flag -# define EC_STUB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define EC_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* EC_STUB_BUILD_DLL */ -#else /* EC_STUB_HAS_DLL == 1 */ -# define EC_STUB_Export -# define EC_STUB_SINGLETON_DECLARATION(T) -# define EC_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* EC_STUB_HAS_DLL == 1 */ - -// Set EC_STUB_NTRACE = 0 to turn on library specific tracing even if -// tracing is turned off for ACE. -#if !defined (EC_STUB_NTRACE) -# if (ACE_NTRACE == 1) -# define EC_STUB_NTRACE 1 -# else /* (ACE_NTRACE == 1) */ -# define EC_STUB_NTRACE 0 -# endif /* (ACE_NTRACE == 1) */ -#endif /* !EC_STUB_NTRACE */ - -#if (EC_STUB_NTRACE == 1) -# define EC_STUB_TRACE(X) -#else /* (EC_STUB_NTRACE == 1) */ -# if !defined (ACE_HAS_TRACE) -# define ACE_HAS_TRACE -# endif /* ACE_HAS_TRACE */ -# define EC_STUB_TRACE(X) ACE_TRACE_IMPL(X) -# include "ace/Trace.h" -#endif /* (EC_STUB_NTRACE == 1) */ - -#endif /* EC_STUB_EXPORT_H */ - -// End of auto generated file. diff --git a/TAO/CIAO/examples/BasicSP/EC/EC_svnt_export.h b/TAO/CIAO/examples/BasicSP/EC/EC_svnt_export.h deleted file mode 100644 index 90bc3cf9f4a..00000000000 --- a/TAO/CIAO/examples/BasicSP/EC/EC_svnt_export.h +++ /dev/null @@ -1,58 +0,0 @@ - -// -*- C++ -*- -// $Id$ -// Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl -s EC_SVNT -// ------------------------------ -#ifndef EC_SVNT_EXPORT_H -#define EC_SVNT_EXPORT_H - -#include "ace/config-all.h" - -#if defined (ACE_AS_STATIC_LIBS) && !defined (EC_SVNT_HAS_DLL) -# define EC_SVNT_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && EC_SVNT_HAS_DLL */ - -#if !defined (EC_SVNT_HAS_DLL) -# define EC_SVNT_HAS_DLL 1 -#endif /* ! EC_SVNT_HAS_DLL */ - -#if defined (EC_SVNT_HAS_DLL) && (EC_SVNT_HAS_DLL == 1) -# if defined (EC_SVNT_BUILD_DLL) -# define EC_SVNT_Export ACE_Proper_Export_Flag -# define EC_SVNT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define EC_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else /* EC_SVNT_BUILD_DLL */ -# define EC_SVNT_Export ACE_Proper_Import_Flag -# define EC_SVNT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define EC_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* EC_SVNT_BUILD_DLL */ -#else /* EC_SVNT_HAS_DLL == 1 */ -# define EC_SVNT_Export -# define EC_SVNT_SINGLETON_DECLARATION(T) -# define EC_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* EC_SVNT_HAS_DLL == 1 */ - -// Set EC_SVNT_NTRACE = 0 to turn on library specific tracing even if -// tracing is turned off for ACE. -#if !defined (EC_SVNT_NTRACE) -# if (ACE_NTRACE == 1) -# define EC_SVNT_NTRACE 1 -# else /* (ACE_NTRACE == 1) */ -# define EC_SVNT_NTRACE 0 -# endif /* (ACE_NTRACE == 1) */ -#endif /* !EC_SVNT_NTRACE */ - -#if (EC_SVNT_NTRACE == 1) -# define EC_SVNT_TRACE(X) -#else /* (EC_SVNT_NTRACE == 1) */ -# if !defined (ACE_HAS_TRACE) -# define ACE_HAS_TRACE -# endif /* ACE_HAS_TRACE */ -# define EC_SVNT_TRACE(X) ACE_TRACE_IMPL(X) -# include "ace/Trace.h" -#endif /* (EC_SVNT_NTRACE == 1) */ - -#endif /* EC_SVNT_EXPORT_H */ - -// End of auto generated file. diff --git a/TAO/CIAO/examples/BasicSP/EC/README b/TAO/CIAO/examples/BasicSP/EC/README deleted file mode 100644 index 7e032780ab1..00000000000 --- a/TAO/CIAO/examples/BasicSP/EC/README +++ /dev/null @@ -1,9 +0,0 @@ -/** - -@page EC README File - - The EC component. This shouldnt be needed if we had a way to -integrate EC sugly into CIAO. We dont at the time of writing this -example on May 12, 2003. Hence this holy hack! - -*/ diff --git a/TAO/CIAO/examples/BasicSP/EC/client.cpp b/TAO/CIAO/examples/BasicSP/EC/client.cpp deleted file mode 100644 index 2c2f34118bc..00000000000 --- a/TAO/CIAO/examples/BasicSP/EC/client.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// $Id$ - -//============================================================== -/** - * @file client.cpp - * - * This is a simple client test program that interact with the EC - * component implementation. This test uses the explicit factory - * operation in the home interface to create a EC component - * instance, run it for a while, and destroy the component instance. - */ -//============================================================== - -#include "ECC.h" -#include "ace/streams.h" -#include "ace/OS_NS_unistd.h" - -int -main (int argc, char *argv[]) -{ - ACE_TRY_NEW_ENV - { - // Initialize orb - CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, "" - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Resolve HomeFinder interface - - CORBA::Object_var obj - = orb->string_to_object ("file://ec.ior" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - BasicSP::ECHome_var home - = BasicSP::ECHome::_narrow (obj.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (home.in ())) - ACE_ERROR_RETURN ((LM_ERROR, "Unable to acquire ECHome objref\n"), -1); - - BasicSP::EC_var pulser - = home->create (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Place to plug in the rate - pulser->hertz (5 - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - pulser->start (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_OS::sleep (45); - - pulser->stop (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - home->remove_component (pulser.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Who is the culprit \n"); - ACE_ERROR_RETURN ((LM_ERROR, - "Uncaught CORBA exception\n"), - 1); - } - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/CIAO/examples/BasicSP/EC/controller.cpp b/TAO/CIAO/examples/BasicSP/EC/controller.cpp deleted file mode 100644 index d52ac54dba9..00000000000 --- a/TAO/CIAO/examples/BasicSP/EC/controller.cpp +++ /dev/null @@ -1,143 +0,0 @@ -// $Id$ - -/** - * @file controller.cpp - * - * This program interact with a EC component, and set the rate of the - * EC. - */ - -#include "ECC.h" -#include "ace/Get_Opt.h" -#include "ace/streams.h" - -const char *rategen_ior_ = 0; -int rate = 2; -int turn_on = 1; - -int -parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "k:r:of"); - int c; - - while ((c = get_opts ()) != -1) - { - switch (c) - { - case 'o': - turn_on = 1; - break; - - case 'f': - turn_on = 0; - break; - - case 'k': - rategen_ior_ = get_opts.opt_arg (); - break; - - case 'r': - rate = atoi (get_opts.opt_arg ()); - break; - - case '?': // display help for use of the server. - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s\n" - "-o (Turn on the rate generator)\n" - "-f (Turn off the rate generator)\n" - "-k <EC IOR> (default is file://rategen.ior)\n" - "-r <rate in hertz> (default is 3)\n" - "\n", - argv [0]), - -1); - break; - } - } - - if (rategen_ior_ == 0) - { - rategen_ior_ = "file://ec.ior"; - } - - if (rate == 0) - { - rate = 3; - } - - return 0; -} - -int -main (int argc, char *argv[]) -{ - ACE_TRY_NEW_ENV - { - // Initialize orb - CORBA::ORB_var orb = CORBA::ORB_init (argc, - argv, - "" - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (parse_args (argc, argv) != 0) - { - return -1; - } - - CORBA::Object_var obj = - orb->string_to_object (rategen_ior_ - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - BasicSP::EC_var pulser - = BasicSP::EC::_narrow (obj.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (pulser.in ())) - { - ACE_ERROR_RETURN ((LM_ERROR, - "Unable to acquire 'EC' objref\n"), - -1); - } - - pulser->hertz (rate - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (turn_on) - { - pulser->hertz (rate - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, "Start up the Event services\n")); - - pulser->start (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - else - { - pulser->stop (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, "Stop the ES\n")); - } - - orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Who is the culprit \n"); - ACE_ERROR_RETURN ((LM_ERROR, - "Uncaught CORBA exception\n"), - 1); - } - ACE_ENDTRY; - - return 0; -} |