~ubuntu-branches/ubuntu/breezy/ace/breezy

« back to all changes in this revision

Viewing changes to TAO/examples/RTCORBA/Activity/Periodic_Task.h

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad, Benjamin Montgomery, Adam Conrad
  • Date: 2005-09-18 22:51:38 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 sarge) (0.1.2 woody)
  • Revision ID: james.westby@ubuntu.com-20050918225138-seav22q6fyylb536
Tags: 5.4.7-3ubuntu1
[ Benjamin Montgomery ]
* Added a patch for amd64 and powerpc that disables the compiler
  option -fvisibility-inlines-hidden

[ Adam Conrad ]
* Added DPATCH_OPTION_CPP=1 to debian/patches/00options to make
  Benjamin's above changes work correctly with dpatch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- C++ -*- */
2
 
//=============================================================================
3
 
/**
4
 
 *  @file Periodic_Task.h
5
 
 *
6
 
 *  Periodic_Task.h,v 1.5 2003/08/06 20:47:00 dhinton Exp
7
 
 *
8
 
 *  Base class for Periodic Tasks
9
 
 *
10
 
 *  @author Pradeep Gore <pradeep@cs.wustl.edu>
11
 
 */
12
 
//=============================================================================
13
 
#ifndef PERIODIC_TASK_H
14
 
#define PERIODIC_TASK_H
15
 
 
16
 
#include "tao/RTCORBA/RTCORBA.h"
17
 
#include "tao/RTCORBA/Priority_Mapping_Manager.h"
18
 
#include "ace/Task.h"
19
 
#include "ace/SString.h"
20
 
#include "JobC.h"
21
 
#include "activity_export.h"
22
 
 
23
 
class ACE_Barrier;
24
 
class ACE_Arg_Shifter;
25
 
class Task_Stats;
26
 
 
27
 
/**
28
 
 * @class Periodic_Task
29
 
 *
30
 
 * @brief Periodic_Task executes jobs.
31
 
 *
32
 
 */
33
 
class activity_Export Periodic_Task : public ACE_Task <ACE_SYNCH>
34
 
{
35
 
 public:
36
 
  /// = Initialization and termination code.
37
 
  Periodic_Task (void);
38
 
  ~Periodic_Task ();
39
 
 
40
 
  /// Init the state of this object.
41
 
  int init_task (ACE_Arg_Shifter& arg_shifter);
42
 
 
43
 
  /// Activate this task, synch on the given barrier.
44
 
  virtual int activate_task (ACE_Barrier* barrier, RTCORBA::PriorityMapping *priority_mapping) = 0;
45
 
 
46
 
  /// Dump the stats collected.
47
 
  void dump_stats (ACE_TCHAR* msg);
48
 
 
49
 
  /// = Job get/set
50
 
  /// Returns the name of the Job exec'ed by this Task.
51
 
  const char* job (void);
52
 
 
53
 
  /// Sets the Job to exec.
54
 
  void job (Job_ptr job);
55
 
 
56
 
 protected:
57
 
  /// All tasks synch at this barrier.
58
 
  ACE_Barrier* barrier_;
59
 
 
60
 
  /// The Job to execute.
61
 
  Job_var job_;
62
 
 
63
 
  /// Name of the Job.
64
 
  ACE_CString name_;
65
 
 
66
 
  /// = Task parameters
67
 
  /// see http://www.cis.ksu.edu/~neilsen/classes/cis721/lectures/lecture2/sld009.htm
68
 
 
69
 
  /// The priority of this task.
70
 
  RTCORBA::Priority task_priority_;
71
 
 
72
 
  /// Period
73
 
  unsigned long period_;
74
 
 
75
 
  /// Worst case exec. time.
76
 
  unsigned long exec_time_;
77
 
 
78
 
  /// Phase
79
 
  long phase_;
80
 
 
81
 
  /// Number of times to exec. Job
82
 
  int iter_;
83
 
 
84
 
  /// A load factor supplied to each Job.
85
 
  int load_;
86
 
 
87
 
  /// = Stats house keeping
88
 
  Task_Stats* task_stats_;
89
 
};
90
 
 
91
 
#endif /* PERIODIC_TASK_H */