summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/ESF/ESF_Delayed_Command.h
blob: b66259c2c4e396a333dbcb0a97c965140e9ae2bb (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
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
/* -*- C++ -*- */
// $Id$
//
// ============================================================================
//
// = LIBRARY
//   ORBSVCS Event Service Framework
//
// = FILENAME
//   ESF_Delayed_Command
//
// = AUTHOR
//   Carlos O'Ryan (coryan@cs.wustl.edu)
//
// ============================================================================

#ifndef TAO_ESF_DELAYED_COMMAND_H
#define TAO_ESF_DELAYED_COMMAND_H

#include "ace/Functor.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

template<class Target, class Object>
class TAO_ESF_Connected_Command : public ACE_Command_Base
{
  // = TITLE
  //   ESF_Connected_Command
  //
  // = DESCRIPTION
  //   Implements a Command object that invokes the connected_i() method
  //   on the target, passing an argument of type Object.
  //
  // = MEMORY MANAGMENT
  //   It does not assume ownership of Object nor the Target
  //   arguments.
  //   Usually allocated from the heap or an allocator; but it is not
  //   self-managed.
  //
  // = LOCKING
  //   No provisions for locking, access must be serialized
  //   externally.
  //
  // = TODO
  //
public:
  TAO_ESF_Connected_Command (Target *target,
                            Object *object);
  // constructor...

  virtual int execute (void *arg);
  // The callback method, if the argument is not nil it is interpreted
  // as a CORBA::Environment.

private:
  Target *target_;
  // The target

  Object *object_;
  // The argument
};

// ****************************************************************

template<class Target, class Object>
class TAO_ESF_Reconnected_Command : public ACE_Command_Base
{
  // = TITLE
  //   ESF_Reconnected_Command
  //
  // = DESCRIPTION
  //   Implements a Command object that invokes the reconnected_i() method
  //   on the target, passing an argument of type Object.
  //
  // = MEMORY MANAGMENT
  //   It does not assume ownership of Object nor the Target
  //   arguments.
  //   Usually allocated from the heap or an allocator; but it is not
  //   self-managed.
  //
  // = LOCKING
  //   No provisions for locking, access must be serialized
  //   externally.
  //
  // = TODO
  //
public:
  TAO_ESF_Reconnected_Command (Target *target,
                            Object *object);
  // constructor...

  virtual int execute (void *arg);
  // The callback method, if the argument is not nil it is interpreted
  // as a CORBA::Environment.

private:
  Target *target_;
  // The target

  Object *object_;
  // The argument
};

// ****************************************************************

template<class Target, class Object>
class TAO_ESF_Disconnected_Command : public ACE_Command_Base
{
  // = TITLE
  //   ESF_Disconnected_Command
  //
  // = DESCRIPTION
  //   Implements a Command object that invokes the disconnected_i()
  //   method on the target, passing an argument of type Object.
  //
  // = MEMORY MANAGMENT
  //   It does not assume ownership of Object nor the Target
  //   arguments.
  //   Usually allocated from the heap or an allocator; but it is not
  //   self-managed.
  //
  // = LOCKING
  //   No provisions for locking, access must be serialized
  //   externally.
  //
  // = TODO
  //
public:
  TAO_ESF_Disconnected_Command (Target *target,
                               Object *object);
  // constructor...

  virtual int execute (void *arg);
  // The callback method, if the argument is not nil it is interpreted
  // as a CORBA::Environment.

private:
  Target *target_;
  // The target

  Object *object_;
  // The argument
};

// ****************************************************************

template<class Target>
class TAO_ESF_Shutdown_Command : public ACE_Command_Base
{
  // = TITLE
  //   ESF_Shutdown_Command
  //
  // = DESCRIPTION
  //   Implements a Command object that invokes the shutdown_i()
  //   method on the target, passing an argument of type Object.
  //
  // = MEMORY MANAGMENT
  //   It does not assume ownership of Object nor the Target
  //   arguments.
  //   Usually allocated from the heap or an allocator; but it is not
  //   self-managed.
  //
  // = LOCKING
  //   No provisions for locking, access must be serialized
  //   externally.
  //
  // = TODO
  //
public:
  TAO_ESF_Shutdown_Command (Target *target);
  // constructor...

  virtual int execute (void *arg);
  // The callback method, if the argument is not nil it is interpreted
  // as a CORBA::Environment.

private:
  Target *target_;
  // The target
};

// ****************************************************************

#if defined (__ACE_INLINE__)
#include "ESF_Delayed_Command.i"
#endif /* __ACE_INLINE__ */

#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
#include "ESF_Delayed_Command.cpp"
#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */

#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
#pragma implementation ("ESF_Delayed_Command.cpp")
#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */

#endif /* TAO_ESF_DELAYED_COMMAND_H */