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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
|
#ifndef TAO_TRADER_CPP
#define TAO_TRADER_CPP
#include "orbsvcs/Trader/Trader_T.h"
#include "orbsvcs/Trader/Trader_Interfaces.h"
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
TAO_Trader<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>::
TAO_Trader (TAO_Trader_Base::Trader_Components components)
{
// @@ Seth, we need a way to propagate the exception out. This will
// not work on platforms using environment variable.
for (int i = LOOKUP_IF; i <= LINK_IF; i++)
this->ifs_[i] = 0;
if (ACE_BIT_ENABLED (components, LOOKUP))
{
TAO_Lookup<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>* lookup;
ACE_NEW (lookup,
(TAO_Lookup<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>) (*this));
this->trading_components ().lookup_if (lookup->_this ());
lookup->_remove_ref ();
this->ifs_[LOOKUP_IF] = lookup;
}
if (ACE_BIT_ENABLED (components, REGISTER))
{
TAO_Register<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>* reg;
ACE_NEW (reg,
(TAO_Register<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>) (*this));
this->trading_components ().register_if (reg->_this ());
reg->_remove_ref ();
this->ifs_[REGISTER_IF] = reg;
}
if (ACE_BIT_ENABLED (components, ADMIN))
{
TAO_Admin<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>* admin;
ACE_NEW (admin,
(TAO_Admin<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>) (*this));
this->trading_components ().admin_if (admin->_this ());
admin->_remove_ref ();
this->ifs_[ADMIN_IF] = admin;
}
if (ACE_BIT_ENABLED (components, PROXY))
{
TAO_Proxy<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>* proxy;
ACE_NEW (proxy,
(TAO_Proxy<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>) (*this));
this->trading_components ().proxy_if (proxy->_this ());
proxy->_remove_ref ();
this->ifs_[PROXY_IF] = proxy;
}
if (ACE_BIT_ENABLED (components, LINK))
{
TAO_Link<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>* link;
ACE_NEW (link,
(TAO_Link<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>) (*this));
this->trading_components ().link_if (link->_this ());
link->_remove_ref ();
this->ifs_[LINK_IF] = link;
}
}
template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
TAO_Trader<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>::~TAO_Trader (void)
{
// Remove Trading Components from POA
for (int i = LOOKUP_IF; i <= LINK_IF; i++)
{
if (this->ifs_[i] != 0)
{
try
{
PortableServer::POA_var poa =
this->ifs_[i]->_default_POA ();
PortableServer::ObjectId_var id =
poa->servant_to_id (this->ifs_[i]);
poa->deactivate_object (id.in ());
}
catch (const CORBA::Exception&)
{
// Don't let exceptions propagate out of this call since
// it's the destructor!
}
}
}
}
template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
TAO_Offer_Database<MAP_LOCK_TYPE>&
TAO_Trader<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>::offer_database (void)
{
return this->offer_database_;
}
template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE> ACE_Lock &
TAO_Trader<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>::lock (void)
{
return this->lock_;
}
template <class IF>
TAO_Trader_Components<IF>::
TAO_Trader_Components (const TAO_Trading_Components_i& comps)
: comps_ (comps)
{
}
template <class IF> CosTrading::Lookup_ptr
TAO_Trader_Components<IF>::lookup_if (void)
{
return CosTrading::Lookup::_duplicate (this->comps_.lookup_if ());
}
template <class IF> CosTrading::Register_ptr
TAO_Trader_Components<IF>::register_if (void)
{
return CosTrading::Register::_duplicate (this->comps_.register_if ());
}
template <class IF> CosTrading::Admin_ptr
TAO_Trader_Components<IF>::admin_if (void)
{
return CosTrading::Admin::_duplicate (this->comps_.admin_if ());
}
template <class IF> CosTrading::Proxy_ptr
TAO_Trader_Components<IF>::proxy_if (void)
{
return CosTrading::Proxy::_duplicate (this->comps_.proxy_if ());
}
template <class IF> CosTrading::Link_ptr
TAO_Trader_Components<IF>::link_if (void)
{
return CosTrading::Link::_duplicate (this->comps_.link_if ());
}
template <class IF>
TAO_Support_Attributes<IF>::
TAO_Support_Attributes (const TAO_Support_Attributes_i& attrs)
: attrs_ (attrs)
{
}
template <class IF> CORBA::Boolean
TAO_Support_Attributes<IF>::supports_modifiable_properties (void)
{
return this->attrs_.supports_modifiable_properties ();
}
template <class IF> CORBA::Boolean
TAO_Support_Attributes<IF>::supports_dynamic_properties (void)
{
return this->attrs_.supports_dynamic_properties ();
}
template <class IF> CORBA::Boolean
TAO_Support_Attributes<IF>::supports_proxy_offers (void)
{
return this->attrs_.supports_proxy_offers ();
}
template <class IF> CosTrading::TypeRepository_ptr
TAO_Support_Attributes<IF>::type_repos ( )
{
return CosTrading::TypeRepository::_duplicate (this->attrs_.type_repos ());
}
template <class IF>
TAO_Import_Attributes<IF>::
TAO_Import_Attributes (const TAO_Import_Attributes_i& attrs)
: attrs_ (attrs)
{
}
template <class IF> CORBA::ULong
TAO_Import_Attributes<IF>::def_search_card (void)
{
return this->attrs_.def_search_card ();
}
template <class IF> CORBA::ULong
TAO_Import_Attributes<IF>::max_search_card (void)
{
return this->attrs_.max_search_card ();
}
template <class IF> CORBA::ULong
TAO_Import_Attributes<IF>::def_match_card (void)
{
return this->attrs_.def_match_card ();
}
template <class IF> CORBA::ULong
TAO_Import_Attributes<IF>::max_match_card (void)
{
return this->attrs_.max_match_card ();
}
template <class IF> CORBA::ULong
TAO_Import_Attributes<IF>::def_return_card (void)
{
return this->attrs_.def_return_card ();
}
template <class IF> CORBA::ULong
TAO_Import_Attributes<IF>::max_return_card (void)
{
return this->attrs_.max_return_card ();
}
template <class IF> CORBA::ULong
TAO_Import_Attributes<IF>::max_list (void)
{
return this->attrs_.max_list ();
}
template <class IF> CORBA::ULong
TAO_Import_Attributes<IF>::def_hop_count (void)
{
return this->attrs_.def_hop_count ();
}
template <class IF> CORBA::ULong
TAO_Import_Attributes<IF>::max_hop_count (void)
{
return this->attrs_.max_hop_count ();
}
template <class IF> CosTrading::FollowOption
TAO_Import_Attributes<IF>::def_follow_policy (void)
{
return this->attrs_.def_follow_policy ();
}
template <class IF> CosTrading::FollowOption
TAO_Import_Attributes<IF>::max_follow_policy (void)
{
return this->attrs_.max_follow_policy ();
}
template <class IF>
TAO_Link_Attributes<IF>::
TAO_Link_Attributes (const TAO_Link_Attributes_i& attrs)
: attrs_ (attrs)
{
}
template <class IF> CosTrading::FollowOption
TAO_Link_Attributes<IF>::max_link_follow_policy (void)
{
return this->attrs_.max_link_follow_policy ();
}
template <class ELEMENT_TYPE> int
TAO_Element_Equal<ELEMENT_TYPE>::
operator () (TAO_DynSequence_i& ,
const ELEMENT_TYPE&)
{
return 1;
}
TAO_END_VERSIONED_NAMESPACE_DECL
#endif /* TAO_TRADER_CPP */
|