2
//=============================================================================
4
* @file Periodic_Task.h
6
* Periodic_Task.h,v 1.5 2003/08/06 20:47:00 dhinton Exp
8
* Base class for Periodic Tasks
10
* @author Pradeep Gore <pradeep@cs.wustl.edu>
12
//=============================================================================
13
#ifndef PERIODIC_TASK_H
14
#define PERIODIC_TASK_H
16
#include "tao/RTCORBA/RTCORBA.h"
17
#include "tao/RTCORBA/Priority_Mapping_Manager.h"
19
#include "ace/SString.h"
21
#include "activity_export.h"
24
class ACE_Arg_Shifter;
28
* @class Periodic_Task
30
* @brief Periodic_Task executes jobs.
33
class activity_Export Periodic_Task : public ACE_Task <ACE_SYNCH>
36
/// = Initialization and termination code.
40
/// Init the state of this object.
41
int init_task (ACE_Arg_Shifter& arg_shifter);
43
/// Activate this task, synch on the given barrier.
44
virtual int activate_task (ACE_Barrier* barrier, RTCORBA::PriorityMapping *priority_mapping) = 0;
46
/// Dump the stats collected.
47
void dump_stats (ACE_TCHAR* msg);
50
/// Returns the name of the Job exec'ed by this Task.
51
const char* job (void);
53
/// Sets the Job to exec.
54
void job (Job_ptr job);
57
/// All tasks synch at this barrier.
58
ACE_Barrier* barrier_;
60
/// The Job to execute.
67
/// see http://www.cis.ksu.edu/~neilsen/classes/cis721/lectures/lecture2/sld009.htm
69
/// The priority of this task.
70
RTCORBA::Priority task_priority_;
73
unsigned long period_;
75
/// Worst case exec. time.
76
unsigned long exec_time_;
81
/// Number of times to exec. Job
84
/// A load factor supplied to each Job.
87
/// = Stats house keeping
88
Task_Stats* task_stats_;
91
#endif /* PERIODIC_TASK_H */