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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
/* -*- C++ -*- */
// $Id$
// ============================================================================
//
// = LIBRARY
// ace
//
// = FILENAME
// ACE_Strategies.h
//
// = AUTHOR
// Doug Schmidt
//
// ============================================================================
#if !defined (ACE_STRATEGIES_H)
#define ACE_STRATEGIES_H
#include "ace/Event_Handler.h"
// Forward decls.
class ACE_Reactor;
class ACE_ReactorEx;
class ACE_Export ACE_Notification_Strategy
// = TITLE
// Abstract class used for notifing an interested party
//
// = DESCRIPTION
// A vehicle for extending the behavior of ACE_Message_Queue wrt
// notification *without subclassing*. Thus, it's an example of
// the Bridge/Strategy patterns.
{
public:
ACE_Notification_Strategy (ACE_Event_Handler *eh,
ACE_Reactor_Mask mask);
virtual ~ACE_Notification_Strategy (void);
virtual int notify (void) = 0;
virtual int notify (ACE_Event_Handler *,
ACE_Reactor_Mask mask) = 0;
protected:
ACE_Event_Handler *eh_;
ACE_Reactor_Mask mask_;
};
class ACE_Export ACE_Reactor_Notification_Strategy : public ACE_Notification_Strategy
// = TITLE
// Used to notify an ACE_Reactor
//
// = DESCRIPTION
// Integrates the ACE_Message_Queue notification into the
// ACE_Reactor::notify() method.
{
public:
ACE_Reactor_Notification_Strategy (ACE_Reactor *reactor,
ACE_Event_Handler *eh,
ACE_Reactor_Mask mask);
virtual int notify (void);
virtual int notify (ACE_Event_Handler *,
ACE_Reactor_Mask mask);
private:
ACE_Reactor *reactor_;
};
class ACE_Export ACE_ReactorEx_Notification_Strategy : public ACE_Notification_Strategy
// = TITLE
// Used to notify an ACE_ReactorEx
//
// = DESCRIPTION
// Integrates the ACE_Message_Queue notification into the
// ACE_ReactorEx::notify() method.
{
public:
ACE_ReactorEx_Notification_Strategy (ACE_ReactorEx *reactorex,
ACE_Event_Handler *eh,
ACE_Reactor_Mask mask);
virtual int notify (void);
virtual int notify (ACE_Event_Handler *,
ACE_Reactor_Mask mask);
private:
ACE_ReactorEx *reactorex_;
};
class ACE_Export ACE_Upcall_Strategy
// = TITLE
// Abstract class used for defining an upcall (callback)
//
// = DESCRIPTION
// A vehicle for extending the behavior of ACE_Timer_Queue wrt
// the upcall (callback) *without subclassing*. Thus, it's an
// example of the Bridge/Strategy patterns.
{
public:
ACE_Upcall_Strategy (void);
virtual ~ACE_Upcall_Strategy (void);
virtual void upcall (ACE_Event_Handler *handler,
const void *arg,
const ACE_Time_Value &cur_time) = 0;
};
// This needs to come here to avoid circular dependencies.
#include "ace/Strategies_T.h"
#endif /* ACE_STRATEGIES_H */
|