diff options
Diffstat (limited to 'TAO/CIAO/examples/Display/RateGen')
-rw-r--r-- | TAO/CIAO/examples/Display/RateGen/RateGen.cidl | 12 | ||||
-rw-r--r-- | TAO/CIAO/examples/Display/RateGen/RateGen.idl | 34 | ||||
-rw-r--r-- | TAO/CIAO/examples/Display/RateGen/RateGen.mpc | 78 | ||||
-rw-r--r-- | TAO/CIAO/examples/Display/RateGen/RateGen_exec.cpp | 341 | ||||
-rw-r--r-- | TAO/CIAO/examples/Display/RateGen/RateGen_exec.h | 188 | ||||
-rw-r--r-- | TAO/CIAO/examples/Display/RateGen/RateGen_exec_export.h | 54 | ||||
-rw-r--r-- | TAO/CIAO/examples/Display/RateGen/RateGen_stub_export.h | 54 | ||||
-rw-r--r-- | TAO/CIAO/examples/Display/RateGen/RateGen_svnt_export.h | 54 | ||||
-rw-r--r-- | TAO/CIAO/examples/Display/RateGen/controller.cpp | 136 |
9 files changed, 0 insertions, 951 deletions
diff --git a/TAO/CIAO/examples/Display/RateGen/RateGen.cidl b/TAO/CIAO/examples/Display/RateGen/RateGen.cidl deleted file mode 100644 index f25875f59b4..00000000000 --- a/TAO/CIAO/examples/Display/RateGen/RateGen.cidl +++ /dev/null @@ -1,12 +0,0 @@ -// $Id$ -*- IDL -*- - -#include "RateGen.idl" - -composition session RateGen_Impl -{ - home executor RateGenHome_exec - { - implements HUDisplay::RateGenHome; - manages RateGen_exec; - }; -}; diff --git a/TAO/CIAO/examples/Display/RateGen/RateGen.idl b/TAO/CIAO/examples/Display/RateGen/RateGen.idl deleted file mode 100644 index e5ec2552762..00000000000 --- a/TAO/CIAO/examples/Display/RateGen/RateGen.idl +++ /dev/null @@ -1,34 +0,0 @@ -// $Id$ - -/** - * @file RateGen.idl - * - * Definition of the RateGen (a rate generator) component. - * - * @author Nanbor Wang <nanbor@cs.wustl.edu> - */ - -#ifndef RATEGEN_IDL -#define RATEGEN_IDL - -#include "../HUDisplay.idl" - -module HUDisplay -{ - component RateGen supports opmode - { - publishes tick Pulse; - - /// The attribute can be configured via the home or the - /// component property file. - attribute long hertz; - }; - - home RateGenHome manages RateGen - { - // Explicit operations - factory new_RateGen (in long hertz); - }; -}; - -#endif /* RATEGEN_IDL */ diff --git a/TAO/CIAO/examples/Display/RateGen/RateGen.mpc b/TAO/CIAO/examples/Display/RateGen/RateGen.mpc deleted file mode 100644 index d063453a020..00000000000 --- a/TAO/CIAO/examples/Display/RateGen/RateGen.mpc +++ /dev/null @@ -1,78 +0,0 @@ -// $Id$ -// This file is generated with "generate_component_mpc.pl -p HUDisplay RateGen" - -project(RateGen_DnC_stub): ciao_client_dnc { - after += HUDisplay_DnC_stub - sharedname = RateGen_DnC_stub - idlflags += -Wb,stub_export_macro=RATEGEN_STUB_Export -Wb,stub_export_include=RateGen_stub_export.h -Wb,skel_export_macro=RATEGEN_SVNT_Export -Wb,skel_export_include=RateGen_svnt_export.h - dynamicflags = RATEGEN_STUB_BUILD_DLL - libs += HUDisplay_DnC_stub - IDL_Files { - RateGen.idl - } - - Source_Files { - RateGenC.cpp - } -} - -project(RateGen_DnC_svnt) : ciao_servant_dnc { - after += HUDisplay_DnC_svnt RateGen_DnC_stub - sharedname = RateGen_DnC_svnt - libs += RateGen_DnC_stub HUDisplay_DnC_stub HUDisplay_DnC_svnt - libpaths += .. - idlflags += -Wb,export_macro=RATEGEN_SVNT_Export -Wb,export_include=RateGen_svnt_export.h - dynamicflags = RATEGEN_SVNT_BUILD_DLL - - CIDL_Files { - RateGen.cidl - } - - IDL_Files { - RateGenE.idl - } - - Source_Files { - RateGenEC.cpp - RateGenS.cpp - RateGen_svnt.cpp - } -} - - -project(RateGen_DnC_exec) : ciao_component_dnc { - after += RateGen_DnC_svnt - sharedname = RateGen_DnC_exec - libs += RateGen_DnC_stub RateGen_DnC_svnt HUDisplay_DnC_stub HUDisplay_DnC_svnt - libpaths += .. - idlflags += -Wb,export_macro=RATEGEN_EXEC_Export -Wb,export_include=RateGen_exec_export.h - dynamicflags = RATEGEN_EXEC_BUILD_DLL - - IDL_Files { - - } - - Source_Files { - - RateGen_exec.cpp - } -} - - - - project (RateGen_DnC_controller) : ciao_client_dnc, valuetype { - exename = controller - after += RateGen_DnC_stub - libs += RateGen_DnC_stub HUDisplay_DnC_stub - libpaths += .. - - IDL_Files { - } - - Source_Files { - controller.cpp - } -} - - - diff --git a/TAO/CIAO/examples/Display/RateGen/RateGen_exec.cpp b/TAO/CIAO/examples/Display/RateGen/RateGen_exec.cpp deleted file mode 100644 index a79c4d0a3b1..00000000000 --- a/TAO/CIAO/examples/Display/RateGen/RateGen_exec.cpp +++ /dev/null @@ -1,341 +0,0 @@ -// $Id$ - -#include "RateGen_exec.h" -#include "CIAO_common.h" -#include "ace/Timer_Queue.h" -#include "ace/Reactor.h" - -//================================================================= - -MyImpl::Pulse_Handler::Pulse_Handler (MyImpl::RateGen_exec_i *cb) - : active_ (0), - done_ (0), - tid_ (0), - pulse_callback_ (cb) -{ - // Nothing - this->reactor (new ACE_Reactor); -} - -MyImpl::Pulse_Handler::~Pulse_Handler () -{ - delete this->reactor (); - this->reactor (0); -} - -int -MyImpl::Pulse_Handler::open_h () -{ - return this->activate (); -} - -int -MyImpl::Pulse_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::Pulse_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::Pulse_Handler::stop (void) -{ - if (this->active_ == 0) // Not valid. - { - return -1; - } - - this->reactor ()->cancel_timer (this); - - this->active_ = 0; - return 0; -} - -int -MyImpl::Pulse_Handler::active (void) -{ - return this->active_; -} - -int -MyImpl::Pulse_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::Pulse_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::Pulse_Handler::svc (void) -{ - this->reactor ()->owner (ACE_OS::thr_self ()); - - while (!this->done_) - { - this->reactor ()->handle_events (); - } - - return 0; -} - -//================================================================= - -MyImpl::RateGen_exec_i::RateGen_exec_i () - : hertz_ (0), - pulser_ (this) -{ - -} - -MyImpl::RateGen_exec_i::RateGen_exec_i (CORBA::Long hz) - : hertz_ (hz), - pulser_ (this) -{ -} - -MyImpl::RateGen_exec_i::~RateGen_exec_i () -{ -} - -CORBA::Long -MyImpl::RateGen_exec_i::hertz (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return this->hertz_; -} - -void -MyImpl::RateGen_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::RateGen_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::RateGen_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::RateGen_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::RateGen_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::RateGen_exec_i::set_session_context\n")); - } - - this->context_ = - HUDisplay::CCM_RateGen_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::RateGen_exec_i::ciao_preactivate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::CCMException)) -{ -} - -void -MyImpl::RateGen_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::RateGen_exec_i::ccm_activate\n")); - } - - this->pulser_.open_h (); -} - -void -MyImpl::RateGen_exec_i::ciao_postactivate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::CCMException)) -{ -} - -void -MyImpl::RateGen_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::RateGen_exec_i::ccm_passivate\n")); - } - - this->pulser_.close_h (); -} - -void -MyImpl::RateGen_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::RateGen_exec_i::ccm_remove\n")); - } -} - -void -MyImpl::RateGen_exec_i::pulse (void) -{ - ACE_TRY_NEW_ENV - { - if (CIAO::debug_level () > 0) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("Pushing HUDisplay::tick event!\n"))); - } - - HUDisplay::tick_var ev = new OBV_HUDisplay::tick (); - - this->context_->push_Pulse (ev.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - // @@ do nothing? - } - ACE_ENDTRY; - -} - -MyImpl::RateGenHome_exec_i::RateGenHome_exec_i () -{ -} - -MyImpl::RateGenHome_exec_i::~RateGenHome_exec_i () -{ -} - -::Components::EnterpriseComponent_ptr -MyImpl::RateGenHome_exec_i::new_RateGen (CORBA::Long /* hertz */ - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - Components::EnterpriseComponent_ptr tmp = 0; - ACE_NEW_THROW_EX (tmp, - MyImpl::RateGen_exec_i, - CORBA::NO_MEMORY ()); - ACE_CHECK_RETURN (tmp); - - return tmp; -} - -::Components::EnterpriseComponent_ptr -MyImpl::RateGenHome_exec_i::create (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::CCMException)) -{ - return new MyImpl::RateGen_exec_i (); -} - - -extern "C" RATEGEN_EXEC_Export ::Components::HomeExecutorBase_ptr -createRateGenHome_Impl (void) -{ - return new MyImpl::RateGenHome_exec_i (); -} diff --git a/TAO/CIAO/examples/Display/RateGen/RateGen_exec.h b/TAO/CIAO/examples/Display/RateGen/RateGen_exec.h deleted file mode 100644 index b6b8031c3bf..00000000000 --- a/TAO/CIAO/examples/Display/RateGen/RateGen_exec.h +++ /dev/null @@ -1,188 +0,0 @@ -// $Id$ - -/** - * @file RateGen_exec.h - * - * Header file for the actualy RateGen and RateGenHome component - * implementation. - * - * @author Nanbor Wang <nanbor@cse.wustl.edu> - */ - -#ifndef RATEGEN_EXEC_H -#define RATEGEN_EXEC_H - -#include "RateGen_exec_export.h" -#include "RateGenEC.h" -#include "tao/LocalObject.h" -#include "ace/Thread_Manager.h" -#include "ace/Task.h" - -namespace MyImpl -{ - // Forward decl. - class RateGen_exec_i; - - /** - * @brief Active pulse generater - */ - class Pulse_Handler : public ACE_Task_Base - { - public: - // Default constructor - Pulse_Handler (RateGen_exec_i *cb); - ~Pulse_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_; - - RateGen_exec_i *pulse_callback_; - - ACE_Thread_Manager thr_mgr_; - }; - - /** - * @class RateGen_exec_i - * - * RateGen executor implementation class. - */ - class RATEGEN_EXEC_Export RateGen_exec_i : - public virtual CIDL_RateGen_Impl::RateGen_exec, - public virtual TAO_Local_RefCounted_Object - { - public: - /// Default constructor. - RateGen_exec_i (); - - /// Initialize with a default frequency. - RateGen_exec_i (CORBA::Long hz); - - /// Default destructor. - ~RateGen_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 Pulse_Handler - void pulse (void); - - protected: - /// Frequency - CORBA::Long hertz_; - - /// Copmponent specific context - HUDisplay::CCM_RateGen_Context_var context_; - - /// An active object that actually trigger the generation of - /// periodic events. - Pulse_Handler pulser_; - }; - - /** - * @class RateGenHome_exec_i - * - * RateGen home executor implementation class. - */ - class RATEGEN_EXEC_Export RateGenHome_exec_i : - public virtual HUDisplay::CCM_RateGenHome, - public virtual TAO_Local_RefCounted_Object - { - public: - /// Default ctor. - RateGenHome_exec_i (); - - /// Default dtor. - ~RateGenHome_exec_i (); - - // Explicit home operations. - - virtual ::Components::EnterpriseComponent_ptr - new_RateGen (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" RATEGEN_EXEC_Export ::Components::HomeExecutorBase_ptr -createRateGenHome_Impl (void); - -#endif /* RATEGEN_EXEC_H */ diff --git a/TAO/CIAO/examples/Display/RateGen/RateGen_exec_export.h b/TAO/CIAO/examples/Display/RateGen/RateGen_exec_export.h deleted file mode 100644 index 8871ff3c649..00000000000 --- a/TAO/CIAO/examples/Display/RateGen/RateGen_exec_export.h +++ /dev/null @@ -1,54 +0,0 @@ - -// -*- C++ -*- -// $Id$ -// Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl RATEGEN_EXEC -// ------------------------------ -#ifndef RATEGEN_EXEC_EXPORT_H -#define RATEGEN_EXEC_EXPORT_H - -#include "ace/config-all.h" - -#if !defined (RATEGEN_EXEC_HAS_DLL) -# define RATEGEN_EXEC_HAS_DLL 1 -#endif /* ! RATEGEN_EXEC_HAS_DLL */ - -#if defined (RATEGEN_EXEC_HAS_DLL) && (RATEGEN_EXEC_HAS_DLL == 1) -# if defined (RATEGEN_EXEC_BUILD_DLL) -# define RATEGEN_EXEC_Export ACE_Proper_Export_Flag -# define RATEGEN_EXEC_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define RATEGEN_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else /* RATEGEN_EXEC_BUILD_DLL */ -# define RATEGEN_EXEC_Export ACE_Proper_Import_Flag -# define RATEGEN_EXEC_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define RATEGEN_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* RATEGEN_EXEC_BUILD_DLL */ -#else /* RATEGEN_EXEC_HAS_DLL == 1 */ -# define RATEGEN_EXEC_Export -# define RATEGEN_EXEC_SINGLETON_DECLARATION(T) -# define RATEGEN_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* RATEGEN_EXEC_HAS_DLL == 1 */ - -// Set RATEGEN_EXEC_NTRACE = 0 to turn on library specific tracing even if -// tracing is turned off for ACE. -#if !defined (RATEGEN_EXEC_NTRACE) -# if (ACE_NTRACE == 1) -# define RATEGEN_EXEC_NTRACE 1 -# else /* (ACE_NTRACE == 1) */ -# define RATEGEN_EXEC_NTRACE 0 -# endif /* (ACE_NTRACE == 1) */ -#endif /* !RATEGEN_EXEC_NTRACE */ - -#if (RATEGEN_EXEC_NTRACE == 1) -# define RATEGEN_EXEC_TRACE(X) -#else /* (RATEGEN_EXEC_NTRACE == 1) */ -# if !defined (ACE_HAS_TRACE) -# define ACE_HAS_TRACE -# endif /* ACE_HAS_TRACE */ -# define RATEGEN_EXEC_TRACE(X) ACE_TRACE_IMPL(X) -# include "ace/Trace.h" -#endif /* (RATEGEN_EXEC_NTRACE == 1) */ - -#endif /* RATEGEN_EXEC_EXPORT_H */ - -// End of auto generated file. diff --git a/TAO/CIAO/examples/Display/RateGen/RateGen_stub_export.h b/TAO/CIAO/examples/Display/RateGen/RateGen_stub_export.h deleted file mode 100644 index cfac37a064b..00000000000 --- a/TAO/CIAO/examples/Display/RateGen/RateGen_stub_export.h +++ /dev/null @@ -1,54 +0,0 @@ - -// -*- C++ -*- -// $Id$ -// Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl RATEGEN_STUB -// ------------------------------ -#ifndef RATEGEN_STUB_EXPORT_H -#define RATEGEN_STUB_EXPORT_H - -#include "ace/config-all.h" - -#if !defined (RATEGEN_STUB_HAS_DLL) -# define RATEGEN_STUB_HAS_DLL 1 -#endif /* ! RATEGEN_STUB_HAS_DLL */ - -#if defined (RATEGEN_STUB_HAS_DLL) && (RATEGEN_STUB_HAS_DLL == 1) -# if defined (RATEGEN_STUB_BUILD_DLL) -# define RATEGEN_STUB_Export ACE_Proper_Export_Flag -# define RATEGEN_STUB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define RATEGEN_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else /* RATEGEN_STUB_BUILD_DLL */ -# define RATEGEN_STUB_Export ACE_Proper_Import_Flag -# define RATEGEN_STUB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define RATEGEN_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* RATEGEN_STUB_BUILD_DLL */ -#else /* RATEGEN_STUB_HAS_DLL == 1 */ -# define RATEGEN_STUB_Export -# define RATEGEN_STUB_SINGLETON_DECLARATION(T) -# define RATEGEN_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* RATEGEN_STUB_HAS_DLL == 1 */ - -// Set RATEGEN_STUB_NTRACE = 0 to turn on library specific tracing even if -// tracing is turned off for ACE. -#if !defined (RATEGEN_STUB_NTRACE) -# if (ACE_NTRACE == 1) -# define RATEGEN_STUB_NTRACE 1 -# else /* (ACE_NTRACE == 1) */ -# define RATEGEN_STUB_NTRACE 0 -# endif /* (ACE_NTRACE == 1) */ -#endif /* !RATEGEN_STUB_NTRACE */ - -#if (RATEGEN_STUB_NTRACE == 1) -# define RATEGEN_STUB_TRACE(X) -#else /* (RATEGEN_STUB_NTRACE == 1) */ -# if !defined (ACE_HAS_TRACE) -# define ACE_HAS_TRACE -# endif /* ACE_HAS_TRACE */ -# define RATEGEN_STUB_TRACE(X) ACE_TRACE_IMPL(X) -# include "ace/Trace.h" -#endif /* (RATEGEN_STUB_NTRACE == 1) */ - -#endif /* RATEGEN_STUB_EXPORT_H */ - -// End of auto generated file. diff --git a/TAO/CIAO/examples/Display/RateGen/RateGen_svnt_export.h b/TAO/CIAO/examples/Display/RateGen/RateGen_svnt_export.h deleted file mode 100644 index b117944836f..00000000000 --- a/TAO/CIAO/examples/Display/RateGen/RateGen_svnt_export.h +++ /dev/null @@ -1,54 +0,0 @@ - -// -*- C++ -*- -// $Id$ -// Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl RATEGEN_SVNT -// ------------------------------ -#ifndef RATEGEN_SVNT_EXPORT_H -#define RATEGEN_SVNT_EXPORT_H - -#include "ace/config-all.h" - -#if !defined (RATEGEN_SVNT_HAS_DLL) -# define RATEGEN_SVNT_HAS_DLL 1 -#endif /* ! RATEGEN_SVNT_HAS_DLL */ - -#if defined (RATEGEN_SVNT_HAS_DLL) && (RATEGEN_SVNT_HAS_DLL == 1) -# if defined (RATEGEN_SVNT_BUILD_DLL) -# define RATEGEN_SVNT_Export ACE_Proper_Export_Flag -# define RATEGEN_SVNT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define RATEGEN_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else /* RATEGEN_SVNT_BUILD_DLL */ -# define RATEGEN_SVNT_Export ACE_Proper_Import_Flag -# define RATEGEN_SVNT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define RATEGEN_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* RATEGEN_SVNT_BUILD_DLL */ -#else /* RATEGEN_SVNT_HAS_DLL == 1 */ -# define RATEGEN_SVNT_Export -# define RATEGEN_SVNT_SINGLETON_DECLARATION(T) -# define RATEGEN_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* RATEGEN_SVNT_HAS_DLL == 1 */ - -// Set RATEGEN_SVNT_NTRACE = 0 to turn on library specific tracing even if -// tracing is turned off for ACE. -#if !defined (RATEGEN_SVNT_NTRACE) -# if (ACE_NTRACE == 1) -# define RATEGEN_SVNT_NTRACE 1 -# else /* (ACE_NTRACE == 1) */ -# define RATEGEN_SVNT_NTRACE 0 -# endif /* (ACE_NTRACE == 1) */ -#endif /* !RATEGEN_SVNT_NTRACE */ - -#if (RATEGEN_SVNT_NTRACE == 1) -# define RATEGEN_SVNT_TRACE(X) -#else /* (RATEGEN_SVNT_NTRACE == 1) */ -# if !defined (ACE_HAS_TRACE) -# define ACE_HAS_TRACE -# endif /* ACE_HAS_TRACE */ -# define RATEGEN_SVNT_TRACE(X) ACE_TRACE_IMPL(X) -# include "ace/Trace.h" -#endif /* (RATEGEN_SVNT_NTRACE == 1) */ - -#endif /* RATEGEN_SVNT_EXPORT_H */ - -// End of auto generated file. diff --git a/TAO/CIAO/examples/Display/RateGen/controller.cpp b/TAO/CIAO/examples/Display/RateGen/controller.cpp deleted file mode 100644 index f90ee66e797..00000000000 --- a/TAO/CIAO/examples/Display/RateGen/controller.cpp +++ /dev/null @@ -1,136 +0,0 @@ -// $Id$ - -#include "RateGenC.h" -#include "ace/streams.h" -#include "ace/Get_Opt.h" - -/** - * @file controller.cpp - * - * This program interact with a RateGen component, using its supported - * interface "opmode" to switch it on/off, and set the rate of the - * RateGen. - */ - -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 <RateGen 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://RateGen.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; - - HUDisplay::RateGen_var pulser = - HUDisplay::RateGen::_narrow (obj.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (pulser.in ())) - { - ACE_ERROR_RETURN ((LM_ERROR, - "Unable to acquire 'RateGen' objref\n"), - -1); - } - - if (turn_on) - { - pulser->hertz (rate - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, "Start up the Rate Generator\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, "Rate Generator stopped\n")); - } - - orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Who is the culprit \n"); - cerr << "Uncaught CORBA exception" << endl; - return 1; - } - ACE_ENDTRY; - - return 0; -} |