Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / examples / RTScheduling / DT_Creator.h
blob0e6ca315bffdb88be9e232b359f6a38f7b1b42c7
1 #ifndef DT_CREATOR_H
2 #define DT_CREATOR_H
4 #include "POA_Holder.h"
5 #include "Job_i.h"
6 #include "Synch_i.h"
7 #include "rtschedtestlib_export.h"
9 #include "tao/RTScheduling/RTScheduler.h"
10 #include "orbsvcs/CosNamingC.h"
12 #include "ace/Service_Config.h"
13 #include "ace/Service_Object.h"
14 #include "ace/Arg_Shifter.h"
15 #include "ace/High_Res_Timer.h"
17 class Thread_Task;
18 class Task;
20 typedef Thread_Task **DT_LIST;
21 typedef POA_Holder **POA_LIST;
22 typedef Job_i **JOB_LIST;
24 class RTSCHEDTESTLIB_Export DT_Creator : public ACE_Service_Object
26 public:
27 DT_Creator (void);
29 virtual ~DT_Creator (void);
31 int init (int argc, ACE_TCHAR *argv []);
33 int dt_task_init (ACE_Arg_Shifter& arg_shifter);
35 virtual void create_distributable_threads (RTScheduling::Current_ptr current);
37 void activate_poa_list (void);
38 void activate_job_list (void);
39 void activate_schedule (void);
41 virtual void yield (time_t suspend_time,
42 Thread_Task* task) = 0;
44 virtual void wait (void) = 0;
46 virtual CORBA::Policy_ptr sched_param (int importance) = 0;
48 virtual Thread_Task* create_thr_task (int importance,
49 time_t start_time,
50 int load,
51 int iter,
52 int dist,
53 char *job_name) = 0;
54 // virtual Task* task (void) = 0;
56 /// Resolve the naming service.
57 int resolve_naming_service (void);
59 int dt_count (void);
61 void dt_ended (void);
62 void job_ended (void);
64 void check_ifexit (void);
66 void log_msg (char* msg);
68 void orb (CORBA::ORB_ptr);
69 CORBA::ORB_ptr orb (void);
71 ACE_Time_Value* base_time (void);
72 void base_time (ACE_Time_Value*);
74 ACE_hrtime_t base_hr_time (void);
76 virtual int total_load (void) = 0;
78 Synch_i* synch (void);
80 void register_synch_obj (void);
82 int activate_root_poa (void);
84 protected:
87 DT_LIST dt_list_;
88 POA_LIST poa_list_;
89 JOB_LIST job_list_;
90 //Fixed_Priority_Scheduler* scheduler_;
91 int dt_count_;
92 int poa_count_;
93 int job_count_;
94 CORBA::ORB_var orb_;
95 /// Mutex to serialize access to our internal state.
96 ACE_Lock* state_lock_;
97 ACE_Lock* shutdown_lock_;
98 int active_dt_count_;
99 int active_job_count_;
100 char** log;
101 ACE_Time_Value* base_time_;
102 /// A naming context.
103 CosNaming::NamingContextExt_var naming_;
104 ACE_TString file_name_;
105 ACE_TString log_file_name_;
106 ACE_High_Res_Timer::global_scale_factor_type gsf_;
107 PortableServer::Servant_var<Synch_i> synch_;
111 #endif /*DT_CREATOR_H*/