summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Factory.h
blob: 7161eb63dfdd45add9eb6eb8eb1572dd4f474f23 (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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
/* -*- C++ -*- */
//=============================================================================
/**
 *  @file   CEC_Factory.h
 *
 *  $Id$
 *
 *  @author Carlos O'Ryan (coryan@cs.wustl.edu)
 */
//=============================================================================


#ifndef TAO_CEC_FACTORY_H
#define TAO_CEC_FACTORY_H

#include /**/ "ace/pre.h"
#include "ace/Service_Object.h"

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

#include "tao/Objref_VarOut_T.h"

#include "event_serv_export.h"

class ACE_Lock;

class TAO_CEC_EventChannel;

class TAO_CEC_Dispatching;
class TAO_CEC_Pulling_Strategy;
class TAO_CEC_ConsumerAdmin;
class TAO_CEC_SupplierAdmin;
class TAO_CEC_ProxyPushConsumer;
class TAO_CEC_ProxyPullConsumer;
class TAO_CEC_ProxyPushSupplier;
class TAO_CEC_ProxyPullSupplier;
template<class PROXY> class TAO_ESF_Proxy_Collection;
class TAO_CEC_ConsumerControl;
class TAO_CEC_SupplierControl;

#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
class TAO_CEC_TypedEventChannel;
class TAO_CEC_TypedProxyPushConsumer;
class TAO_CEC_TypedConsumerAdmin;
class TAO_CEC_TypedSupplierAdmin;
#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */

typedef TAO_ESF_Proxy_Collection<TAO_CEC_ProxyPushConsumer> TAO_CEC_ProxyPushConsumer_Collection;
#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
typedef TAO_ESF_Proxy_Collection<TAO_CEC_TypedProxyPushConsumer> TAO_CEC_TypedProxyPushConsumer_Collection;
#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
typedef TAO_ESF_Proxy_Collection<TAO_CEC_ProxyPullConsumer> TAO_CEC_ProxyPullConsumer_Collection;
typedef TAO_ESF_Proxy_Collection<TAO_CEC_ProxyPushSupplier> TAO_CEC_ProxyPushSupplier_Collection;
typedef TAO_ESF_Proxy_Collection<TAO_CEC_ProxyPullSupplier> TAO_CEC_ProxyPullSupplier_Collection;

/**
 * @class TAO_CEC_Factory
 *
 * @brief Abstract factory for the CosEventChannel components.
 *
 * The CosEventChannel implementation can be configured at
 * initialization time through several strategies and
 * components. This class defines the interface of an Abstract
 * Factory that creates all such components.
 * = MEMORY MANAGMENT
 * The objects it creates are owned by this class, the client must
 * invoke the corresponding destroy() method to release them.
 * Some implementations may require a different instance for the
 * CEC_Factory for each instance of a CEC_EventChannel.
 */
class TAO_Event_Serv_Export TAO_CEC_Factory : public ACE_Service_Object
{
public:
  /// destructor...
  virtual ~TAO_CEC_Factory (void);

  /// Create and destroy the dispatching module.
  virtual TAO_CEC_Dispatching*
      create_dispatching (TAO_CEC_EventChannel*) = 0;
#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
  virtual TAO_CEC_Dispatching*
      create_dispatching (TAO_CEC_TypedEventChannel*) = 0;
#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
  virtual void
      destroy_dispatching (TAO_CEC_Dispatching*)  = 0;

  /// Create and destroy the pulling strategy.
  virtual TAO_CEC_Pulling_Strategy*
      create_pulling_strategy (TAO_CEC_EventChannel*) = 0;
  virtual void
      destroy_pulling_strategy (TAO_CEC_Pulling_Strategy*)  = 0;

  /// Create and destroy the consumer admin implementation.
  virtual TAO_CEC_ConsumerAdmin*
      create_consumer_admin (TAO_CEC_EventChannel*)  = 0;
  virtual void
      destroy_consumer_admin (TAO_CEC_ConsumerAdmin*) = 0;
#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
  virtual TAO_CEC_TypedConsumerAdmin*
      create_consumer_admin (TAO_CEC_TypedEventChannel*)  = 0;
  virtual void
      destroy_consumer_admin (TAO_CEC_TypedConsumerAdmin*) = 0;
#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */

  /// Create and destroy the supplier admin implementation.
  virtual TAO_CEC_SupplierAdmin*
      create_supplier_admin (TAO_CEC_EventChannel*)  = 0;
  virtual void
      destroy_supplier_admin (TAO_CEC_SupplierAdmin*) = 0;
#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
  virtual TAO_CEC_TypedSupplierAdmin*
      create_supplier_admin (TAO_CEC_TypedEventChannel*)  = 0;
  virtual void
      destroy_supplier_admin (TAO_CEC_TypedSupplierAdmin*) = 0;
#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */

  /// Create and destroy a ProxyPushSupplier
  virtual TAO_CEC_ProxyPushSupplier*
      create_proxy_push_supplier (TAO_CEC_EventChannel*) = 0;
#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
  virtual TAO_CEC_ProxyPushSupplier*
      create_proxy_push_supplier (TAO_CEC_TypedEventChannel*) = 0;
#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
  virtual void
      destroy_proxy_push_supplier (TAO_CEC_ProxyPushSupplier*) = 0;

  /// Create and destroy a ProxyPullSupplier
  virtual TAO_CEC_ProxyPullSupplier*
      create_proxy_pull_supplier (TAO_CEC_EventChannel*) = 0;
  virtual void
      destroy_proxy_pull_supplier (TAO_CEC_ProxyPullSupplier*) = 0;

  /// Create and destroy a ProxyPushConsumer
  virtual TAO_CEC_ProxyPushConsumer*
      create_proxy_push_consumer (TAO_CEC_EventChannel*) = 0;
  virtual void
      destroy_proxy_push_consumer (TAO_CEC_ProxyPushConsumer*) = 0;

#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
  /// Create and destroy a TypedProxyPushConsumer
  virtual TAO_CEC_TypedProxyPushConsumer*
      create_proxy_push_consumer (TAO_CEC_TypedEventChannel*) = 0;
  virtual void
      destroy_proxy_push_consumer (TAO_CEC_TypedProxyPushConsumer*) = 0;
#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */

  /// Create and destroy a ProxyPullConsumer
  virtual TAO_CEC_ProxyPullConsumer*
      create_proxy_pull_consumer (TAO_CEC_EventChannel*) = 0;
  virtual void
      destroy_proxy_pull_consumer (TAO_CEC_ProxyPullConsumer*) = 0;

  /// Create and destroy a collection of TAO_CEC_ProxyPushConsumers
  virtual TAO_CEC_ProxyPushConsumer_Collection*
      create_proxy_push_consumer_collection (TAO_CEC_EventChannel*) = 0;
  virtual void
      destroy_proxy_push_consumer_collection (TAO_CEC_ProxyPushConsumer_Collection*) = 0;

#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
  /// Create and destroy a collection of TAO_CEC_TypedProxyPushConsumers
  virtual TAO_CEC_TypedProxyPushConsumer_Collection*
      create_proxy_push_consumer_collection (TAO_CEC_TypedEventChannel*) = 0;
  virtual void
      destroy_proxy_push_consumer_collection (TAO_CEC_TypedProxyPushConsumer_Collection*) = 0;
#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */

  /// Create and destroy a collection of TAO_CEC_ProxyPullConsumers
  virtual TAO_CEC_ProxyPullConsumer_Collection*
      create_proxy_pull_consumer_collection (TAO_CEC_EventChannel*) = 0;
  virtual void
      destroy_proxy_pull_consumer_collection (TAO_CEC_ProxyPullConsumer_Collection*) = 0;

  /// Create and destroy a collection of TAO_CEC_ProxyPushSuppliers
  virtual TAO_CEC_ProxyPushSupplier_Collection*
      create_proxy_push_supplier_collection (TAO_CEC_EventChannel*) = 0;
#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
  virtual TAO_CEC_ProxyPushSupplier_Collection*
      create_proxy_push_supplier_collection (TAO_CEC_TypedEventChannel*) = 0;
#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
  virtual void
      destroy_proxy_push_supplier_collection (TAO_CEC_ProxyPushSupplier_Collection*) = 0;

  /// Create and destroy a collection of TAO_CEC_ProxyPullSuppliers
  virtual TAO_CEC_ProxyPullSupplier_Collection*
      create_proxy_pull_supplier_collection (TAO_CEC_EventChannel*) = 0;
  virtual void
      destroy_proxy_pull_supplier_collection (TAO_CEC_ProxyPullSupplier_Collection*) = 0;

  /// Create and destroy the locking strategies for both
  /// ProxyPushConsumers and ProxyPushSuppliers
  virtual ACE_Lock* create_consumer_lock (void) = 0;
  virtual void destroy_consumer_lock (ACE_Lock*) = 0;
  virtual ACE_Lock* create_supplier_lock (void) = 0;
  virtual void destroy_supplier_lock (ACE_Lock*) = 0;

  /// The ConsumerControl and SupplierControl strategies are used to
  /// discard non-existent consumers and suppliers
  virtual TAO_CEC_ConsumerControl*
      create_consumer_control (TAO_CEC_EventChannel*) = 0;
#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
  virtual TAO_CEC_ConsumerControl*
      create_consumer_control (TAO_CEC_TypedEventChannel*) = 0;
#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
  virtual void
      destroy_consumer_control (TAO_CEC_ConsumerControl*) = 0;
  virtual TAO_CEC_SupplierControl*
      create_supplier_control (TAO_CEC_EventChannel*) = 0;
#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
  virtual TAO_CEC_SupplierControl*
      create_supplier_control (TAO_CEC_TypedEventChannel*) = 0;
#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
  virtual void
      destroy_supplier_control (TAO_CEC_SupplierControl*) = 0;
};

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

#include /**/ "ace/post.h"
#endif /* TAO_CEC_FACTORY_H */