diff options
author | thrall <thrall@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-10-08 22:08:53 +0000 |
---|---|---|
committer | thrall <thrall@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-10-08 22:08:53 +0000 |
commit | 7e83a1bb944f50b67f118923afd055d5cb5b1fa6 (patch) | |
tree | 7c4ccc1d8970e6b7594e67c7ce3b3708efb69569 /TAO/orbsvcs/tests/EC_Config/ECConfig.h | |
parent | 97abc1130e52c2bfb312f467cefbb75ff45eea22 (diff) | |
download | ATCD-7e83a1bb944f50b67f118923afd055d5cb5b1fa6.tar.gz |
Lots of changes. Refactored RT_Info creation into TimeoutConsumer,EC_Kokyu_0
Consumer. Spawns thread for orb->run(), shuts down correctly when all
events sent from TimeoutConsumers.
Diffstat (limited to 'TAO/orbsvcs/tests/EC_Config/ECConfig.h')
-rw-r--r-- | TAO/orbsvcs/tests/EC_Config/ECConfig.h | 52 |
1 files changed, 29 insertions, 23 deletions
diff --git a/TAO/orbsvcs/tests/EC_Config/ECConfig.h b/TAO/orbsvcs/tests/EC_Config/ECConfig.h index cef06505ecc..e0b3b1c2384 100644 --- a/TAO/orbsvcs/tests/EC_Config/ECConfig.h +++ b/TAO/orbsvcs/tests/EC_Config/ECConfig.h @@ -15,7 +15,8 @@ #define ECCONFIG_H #include "ace/Array.h" -#include "ace/Synch.h" +//#include "ace/Synch.h" +#include "ace/RW_Mutex.h" #include "orbsvcs/RtecSchedulerS.h" //for POA_RtecScheduler #include "orbsvcs/RtecSchedulerC.h" #include "orbsvcs/RtecEventChannelAdminC.h" @@ -23,7 +24,7 @@ #include "TestConfig.h" #include "Consumer.h" -#include "Supplier.h" +#include "TimeoutConsumer.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -34,9 +35,12 @@ namespace TestConfig { typedef ACE_Array<RtecEventChannelAdmin::ProxyPushConsumer_var> ProxyList; typedef ACE_Array<RtecScheduler::handle_t> ConfigList; typedef ACE_Array<RtecEventComm::EventSourceID> SupplierIDList; +typedef ACE_Array<TimeBase::TimeT> PeriodList; +typedef ACE_Array<RtecScheduler::Importance_t> ImportanceList; +typedef ACE_Array<RtecScheduler::Criticality_t> CritList; typedef ACE_Array<Consumer*> ConsumerList; -typedef ACE_Array<Supplier*> SupplierList; +typedef ACE_Array<TimeoutConsumer*> SupplierList; template <class SCHED_STRAT> class ECConfig : public Test_Config { @@ -60,19 +64,26 @@ public: //events. protected: - virtual int initEC (void); + // TODO USE DEFAULTS FOR ANY OF THESE? - virtual int connectConsumers (void); + virtual void initEC (ACE_ENV_SINGLE_ARG_DECL); - virtual int connectSuppliers (void); + void connect_suppliers (ACE_ENV_SINGLE_ARG_DECL); - virtual void reset (void); - // + void disconnect_suppliers (ACE_ENV_SINGLE_ARG_DECL); + + void connect_consumers (ACE_ENV_SINGLE_ARG_DECL); + + void disconnect_consumers (ACE_ENV_SINGLE_ARG_DECL); + + virtual void reset (ACE_ENV_SINGLE_ARG_DECL); private: void print_RT_Infos (ACE_Array<RtecScheduler::handle_t> cfg_set); + static ACE_THR_FUNC_RETURN run_orb(void *data); //thread fcn for running ORB + Test_Config_Set testcfgs; //copy of the currently configured Test_Config_Set //using the same test_config_t objects @@ -86,30 +97,25 @@ private: RtecEventChannelAdmin::EventChannel_var event_channel; RtecScheduler::Scheduler_var scheduler; - /* - ACE_Strong_Bound_Ptr<TAO_EC_Event_Channel,ACE_Null_Mutex> ec_impl; - ACE_Strong_Bound_Ptr<POA_RtecScheduler::Scheduler,ACE_Null_Mutex> sched_impl; - */ TAO_EC_Event_Channel *ec_impl; - POA_RtecScheduler::Scheduler *sched_impl; + SCHED_STRAT *sched_impl; - ProxyList consumer_proxys; - //proxy objects for pushing events to consumers + ConsumerList consumers; - ConfigList supplier_cfgs; - //RT_Infos generated by configure() for suppliers. + SupplierList suppliers; - ConfigList consumer_cfgs; - //RT_Infos generated by configure() for consumers. + PeriodList periods; - SupplierIDList supplier_ids; - //IDs of the suppliers + ImportanceList importances; - ConsumerList consumers; + CritList crits; - SupplierList suppliers; + ACE_RW_Mutex* test_done; + //TimeoutConsumers acquire read locks; when the ECConfig can acquire + //a write lock, all TimeoutConsumers must've finished, so the test + //is finished. int configured; //boolean }; |