2 //=============================================================================
4 * @file Periodic_Task.h
6 * Base class for Periodic Tasks
8 * @author Pradeep Gore <pradeep@cs.wustl.edu>
10 //=============================================================================
11 #ifndef PERIODIC_TASK_H
12 #define PERIODIC_TASK_H
14 #include "tao/RTCORBA/RTCORBA.h"
15 #include "tao/RTCORBA/Priority_Mapping_Manager.h"
17 #include "ace/SString.h"
18 #include "ace/Arg_Shifter.h"
21 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
23 ACE_END_VERSIONED_NAMESPACE_DECL
28 * @class Periodic_Task
30 * @brief Periodic_Task executes jobs.
32 class Periodic_Task
: public ACE_Task
<ACE_SYNCH
>
38 /// Init the state of this object.
39 int init_task (ACE_Arg_Shifter
& arg_shifter
);
41 /// Activate this task, synch on the given barrier.
42 virtual int activate_task (ACE_Barrier
* barrier
, RTCORBA::PriorityMapping
*priority_mapping
) = 0;
44 /// Dump the stats collected.
45 void dump_stats (ACE_TCHAR
* msg
);
48 /// Returns the name of the Job exec'ed by this Task.
49 const char* job (void);
51 /// Sets the Job to exec.
52 void job (Job_ptr job
);
55 /// All tasks synch at this barrier.
56 ACE_Barrier
* barrier_
;
58 /// The Job to execute.
65 /// see http://www.cis.ksu.edu/~neilsen/classes/cis721/lectures/lecture2/sld009.htm
67 /// The priority of this task.
68 RTCORBA::Priority task_priority_
;
71 unsigned long period_
;
73 /// Worst case exec. time.
74 unsigned long exec_time_
;
79 /// Number of times to exec. Job
82 /// A load factor supplied to each Job.
85 /// = Stats house keeping
86 Task_Stats
* task_stats_
;
89 #endif /* PERIODIC_TASK_H */