summaryrefslogtreecommitdiff
path: root/TAO/local/bin/Event_Service/ReactorTask.h
blob: 61a5a93c6ae7da377d718eceeea636a2983190d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// $Id$

#if !defined ACE_ReactorTask_H
#define ACE_ReactorTask_H

// BBM, moved this here from UPSingleProcessorOrb.h
//## begin module.includes preserve=yes
#include "Fast_Reactor.h"
#if defined (ACE_OLD_STYLE_REACTOR)
# define ACE_ORB_REACTOR ACE_ES_Fast_Reactor
#endif /* ACE_OLD_STYLE_REACTOR */
//## end module.includes

// Added these.
#include "ace/Timer_Heap.h"
#include "ace/Timer_List.h"

#include "Local_ESTypes.h"
#include "RT_Task.h"

class ACE_ES_Reactor_Task : public ACE_RT_Task
// = TITLE
//    Event Service Timer Task
//
// = DESCRIPTION
//    An active object that dispatches timers from its own ReactorEx.
{
public:
  // BBM, added this.
#if defined (ACE_OLD_STYLE_REACTOR)
  typedef ACE_ORB_REACTOR Reactor;
#else
  typedef ACE_Reactor Reactor;
#endif /* ACE_OLD_STYLE_REACTOR */

  ACE_ES_Reactor_Task();
  // Default construction.

  ~ACE_ES_Reactor_Task();
  // Destruction.

  virtual int svc_hook(RtecScheduler::OS_Priority);
  // Assume ownership of the reactor_.

  // Brian, this is new.
  int open_reactor (RtecScheduler::Period &period);
  // This is a hack for now.

  virtual int svc_one();
  // Calls reactor_.handle_events until done_ is set.

  void shutdown_task();
  // Sets done_ and notifies the reactor_.

  Reactor &get_reactor();
  // ReactorEx accessor.

  virtual void threads_closed();
  // Deletes this.

private:
  ACE_Timer_List timer_queue_;
  // The timer storage mechanism used by reactor_.

#if !defined (ACE_OLD_STYLE_REACTOR)
  ACE_ES_Fast_Reactor fast_reactor_;
  // The timer dispatch mechanism.
#endif /* ! ACE_OLD_STYLE_REACTOR */

  Reactor reactor_;
  // "Public" handle to fast_reactor_.

  sig_atomic_t done_;
  // When set, end the event loop.
};

#endif /* ACE_ReactorTask_H */