diff options
author | thrall <thrall@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2004-10-22 02:42:39 +0000 |
---|---|---|
committer | thrall <thrall@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2004-10-22 02:42:39 +0000 |
commit | f6ce2af80bf58653ad248a4037924658f5a1a779 (patch) | |
tree | eb61791c376b09f5315aaaa5c6f11d97f4322ae6 | |
parent | ab431815c70746858a92344adc39e4dace7a27da (diff) | |
download | ATCD-f6ce2af80bf58653ad248a4037924658f5a1a779.tar.gz |
Added reactor() and init()
-rw-r--r-- | TAO/orbsvcs/examples/RtEC/ECConfigurator/ECDriver.cpp | 29 | ||||
-rw-r--r-- | TAO/orbsvcs/examples/RtEC/ECConfigurator/ECDriver.h | 13 |
2 files changed, 34 insertions, 8 deletions
diff --git a/TAO/orbsvcs/examples/RtEC/ECConfigurator/ECDriver.cpp b/TAO/orbsvcs/examples/RtEC/ECConfigurator/ECDriver.cpp index 668ed0afaca..bbede997c69 100644 --- a/TAO/orbsvcs/examples/RtEC/ECConfigurator/ECDriver.cpp +++ b/TAO/orbsvcs/examples/RtEC/ECConfigurator/ECDriver.cpp @@ -37,6 +37,16 @@ ECTestDriver::~ECTestDriver (void) { } +int +ECTestDriver::init(CORBA::ORB_var orb, PortableServer::POA_var poa) +{ + ECDriver::init(orb,poa); + + this->rt.initialize(); + + return 0; +} + bool ECTestDriver::get_time_master (void) const { @@ -53,11 +63,11 @@ void ECTestDriver::set_start_condition(StartCondition::TYPE type, Time time) ACE_THROW_SPEC ((ACEXML_SAXException)) { - if (type != StartCondition::GLOBALTIME) + if (type != StartCondition::DELAYAFTERCONNECT) { ACEXML_THROW (ACEXML_SAXException ("ECTestDriver does not support" " start condition types other than" - "GLOBALTIME")); + "DELAYAFTERCONNECT")); } this->starttype = type; @@ -112,13 +122,15 @@ ECTestDriver::wait_for_start(Kokyu_EC* ec) } } -void -ECTestDriver::run_i (int argc, char *argv[]) +ACE_Reactor* +ECTestDriver::reactor(void) { - //spawn thread to run the reactor event loop - Reactor_Task rt; - rt.initialize(); + return this->rt.reactor(); +} //reactor() +void +ECTestDriver::run_i (int, char **) +{ ACE_hthread_t thr_handle; ACE_Thread::self (thr_handle); @@ -128,6 +140,7 @@ ECTestDriver::run_i (int argc, char *argv[]) // for DURATION, limit is in msecs ACE_Time_Value stop_time(this->stoplimit/1000,this->stoplimit%1000); - rt.activate(); //need thread creation flags? or priority? + //spawn thread to run the reactor event loop + this->rt.activate(); //need thread creation flags? or priority? orb->run (stop_time ACE_ENV_ARG_PARAMETER); } //run_i() diff --git a/TAO/orbsvcs/examples/RtEC/ECConfigurator/ECDriver.h b/TAO/orbsvcs/examples/RtEC/ECConfigurator/ECDriver.h index 8c80f09bf65..92b429d1711 100644 --- a/TAO/orbsvcs/examples/RtEC/ECConfigurator/ECDriver.h +++ b/TAO/orbsvcs/examples/RtEC/ECConfigurator/ECDriver.h @@ -16,7 +16,9 @@ #include "RtSchedEventChannelC.h" #include "SyntaxTree.h" +#include "Kokyu_EC.h" // Reactor_Task +#include "ace/Reactor.h" #include "tao/ORB.h" #include "tao/PortableServer/PortableServer.h" @@ -46,6 +48,12 @@ public: virtual void set_stop_condition(StopCondition::TYPE type, long limit) ACE_THROW_SPEC ((ACEXML_SAXException)) = 0; + /** + * The Configurator_SyntaxHandler needs a reactor to schedule + * Gateway initialization timeouts; the ECDriver must provide it + * and run it. + */ + virtual ACE_Reactor* reactor(void) = 0; protected: virtual void run_i(int argc, char *argv[]) = 0; @@ -61,6 +69,8 @@ public: virtual ~ECTestDriver (void); + virtual int init(CORBA::ORB_var orb, PortableServer::POA_var poa); + virtual bool get_time_master (void) const; virtual void set_time_master (bool tm); @@ -72,11 +82,14 @@ public: virtual void wait_for_start(Kokyu_EC* ec) ACE_THROW_SPEC ((ACEXML_SAXException)); + virtual ACE_Reactor* reactor(void); protected: virtual void run_i(int argc, char *argv[]); bool time_master; + Reactor_Task rt; + StartCondition::TYPE starttype; Time starttime; StopCondition::TYPE stoptype; |