summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Trader/Attributes.h
blob: ad78cd410a41163fe51200a9d724cad67e6bd152 (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
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
/* -*- C++ -*- */

// ========================================================================
// $Id$
// 
// = LIBRARY
//    orbsvcs
// 
// = FILENAME
//    Attributes.h
//
// = AUTHOR
//    Marina Spivak <marina@cs.wustl.edu>
//    Seth Widoff <sbw1@cs.wustl.edu>
//    Irfan Pyarali <irfan@cs.wustl.edu>
// 
// ========================================================================

#ifndef TAO_ATTRIBUTES_H
#define TAO_ATTRIBUTES_H

#include "orbsvcs/CosTradingS.h"

class TAO_Lockable
// = DESCRIPTION
//   Class used to remove the circular dependencies between the
//   Attribute classes with the Trader class.  
{
public: 

  virtual ACE_Lock& lock (void) = 0;  
};


class TAO_ORBSVCS_Export TAO_Support_Attributes_Impl
  // = TITLE
  //     This class stores, allows access to and modification of 
  //     trader's support attributes.
  //
  // = DESCRIPTION
  //     Contains a reference to the trader from which it is
  //     used so it can use trader's lock.
{
public:
  // = Initialization and termination methods.
  TAO_Support_Attributes_Impl (TAO_Lockable &locker);
  ~TAO_Support_Attributes_Impl ();

  // = Accessor methods.
  CORBA::Boolean supports_modifiable_properties (void) const;
  void supports_modifiable_properties (CORBA::Boolean);

  CORBA::Boolean supports_dynamic_properties (void) const;
  void supports_dynamic_properties (CORBA::Boolean);

  CORBA::Boolean supports_proxy_offers (void) const;
  void supports_proxy_offers (CORBA::Boolean);

  CosTrading::TypeRepository_ptr type_repos (void) const;
  void type_repos (CosTrading::TypeRepository_ptr);

private:

  TAO_Lockable &locker_;
  // A reference to the trader (needed for obtaining the lock.)

  CORBA::Boolean supports_modifiable_properties_;
  // Indicator of whether the trader supports property modification.

  CORBA::Boolean supports_dynamic_properties_;
  // Indicator of whether the trader supports dynamic properties.

  CORBA::Boolean supports_proxy_offers_;
  // Indicator of whether the trader supports proxy offers.

  CORBA::Object_var type_repos_;
  // A reference to the TypeRepostitory used by the trader.
};

class TAO_ORBSVCS_Export TAO_Link_Attributes_Impl
  // = TITLE
  //     This class stores, allows access to and modification of 
  //     trader's link attributes.
  //
  // = DESCRIPTION
  //     Contains a reference to the trader from which it is
  //     used so it can use trader's lock.
{
public:
  // = Initialization and termination methods.

  TAO_Link_Attributes_Impl (TAO_Lockable &locker);
  ~TAO_Link_Attributes_Impl ();

  // = Accessor methods.
  
  CosTrading::FollowOption max_link_follow_policy (void) const;
  void  max_link_follow_policy (CosTrading::FollowOption);

private:

  TAO_Lockable &locker_;
  // A reference to the trader (needed for obtaining the lock.)

  CosTrading::FollowOption max_link_follow_policy_;
  // 
};

class TAO_ORBSVCS_Export TAO_Import_Attributes_Impl
  // = TITLE
  //     This class stores, allows access to and modification of 
  //     trader's import attributes.
  //
  // = DESCRIPTION
  //     Contains a reference to the trader from which it is
  //     used so it can use trader's lock.
{
public:
  // = Initialization and termination methods.

  TAO_Import_Attributes_Impl (TAO_Lockable &locker);

  ~TAO_Import_Attributes_Impl (void);

  // = Accessor methods.
  
  CORBA::ULong def_search_card (void) const;
  void def_search_card (CORBA::ULong);
	
  CORBA::ULong max_search_card (void) const;
  void max_search_card (CORBA::ULong);

  CORBA::ULong def_match_card (void) const;
  void def_match_card (CORBA::ULong);

  CORBA::ULong max_match_card (void) const;
  void max_match_card (CORBA::ULong);

  CORBA::ULong def_return_card (void) const;
  void def_return_card (CORBA::ULong);

  CORBA::ULong max_return_card (void) const;
  void max_return_card (CORBA::ULong);

  CORBA::ULong max_list (void) const;
  void max_list (CORBA::ULong);

  CORBA::ULong def_hop_count (void) const;
  void def_hop_count (CORBA::ULong);

  CORBA::ULong max_hop_count (void) const;
  void max_hop_count (CORBA::ULong);

  CosTrading::FollowOption def_follow_policy (void) const;
  void def_follow_policy (CosTrading::FollowOption);

  CosTrading::FollowOption max_follow_policy (void) const;
  void max_follow_policy (CosTrading::FollowOption);

private:

  TAO_Lockable &locker_;

  CORBA::ULong def_search_card_;
  // Upper bound of offers to be searched if <search_card>
  // is not specified.  

  CORBA::ULong max_search_card_;
  // Maximum upper bound of offers to be searched.

  CORBA::ULong def_match_card_;
  // Upper bound of matched offers to be ordered if 
  // <match_card> is not specified).  

  CORBA::ULong max_match_card_; 
  // Maximum upper bound of matched offers to be ordered.

  CORBA::ULong def_return_card_;
  // Upper bound of ordered offers to be returned if 
  // <returned_card> is not specified.

  CORBA::ULong max_return_card_; 
  // Maximum upper bound of ordered offers to be returned.

  CORBA::ULong max_list_;
  // Upper bound of depth
    
  CORBA::ULong def_hop_count_;
  // Upper bound of depth of links to be traversed if <hop_count> is
  // not specified.

  CORBA::ULong max_hop_count_;
  // Maximum upper bound of depth of links to be traversed.
    
  CosTrading::FollowOption def_follow_policy_;
  // Default link follow policy for a particular trader.

  CosTrading::FollowOption max_follow_policy_;
  // Limiting link follow policy for all links of the trader -
  // overrides both link and importer policies.
};

class TAO_ORBSVCS_Export TAO_Trading_Components_Impl
  //
  // = TITLE
  //     Set/get methods for references to various
  //     interfaces of the trader.
  //
  // = DESCRIPTION
  //     Note, this class is for use in local address space only and is NOT a
  //     direct implementation of IDL methods. (Implementation of 
  //     IDL methods in CosTrading::Trader_Components would need
  //     add a _duplicate call for each get method). 
{
public:

  // = Initialization and termination methods.
  TAO_Trading_Components_Impl (TAO_Lockable &locker);
  ~TAO_Trading_Components_Impl (void);

  // = CosTrading::TraderComponents methods. 

  CosTrading::Lookup_ptr lookup_if (void) const;
  // Returns an object reference to the Lookup interface of the trader.
  // Returns nil if the trader does not support Lookup interface.

  void lookup_if (CosTrading::Lookup_ptr);
  // Set the reference to the Lookup interface.
  
  CosTrading::Register_ptr register_if (void) const;
  // Returns object reference for the Register interface of the trader.
  // Returns nil if the trader does not support Register interface.

  void register_if (CosTrading::Register_ptr);
  // Set the reference to the Register interface of the trader.
  
  CosTrading::Link_ptr link_if (void) const;
  // Returns object reference for the Link interface of the trader.
  // Returns nil if the trader does not support Link interface.

  void link_if (CosTrading::Link_ptr);
  // Set the reference to the Link interface of the trader.

  CosTrading::Proxy_ptr proxy_if (void) const;
  // Returns object reference to the Proxy interface of the trader.
  // Returns nil if the trader does not support Proxy interface. 

  void proxy_if (CosTrading::Proxy_ptr);
  // Set the reference to the Proxy interface of the trader.
  
  CosTrading::Admin_ptr admin_if (void) const;
  // Returns object reference for the Admin interface of the trader.
  // Returns nil if the trader does not support Admin interface.

  void admin_if (CosTrading::Admin_ptr);
  // Set the reference to the Admin interface of the trader.

private:

  TAO_Lockable &locker_;

  CosTrading::Lookup_var lookup_;
  CosTrading::Register_var register_;
  CosTrading::Link_var link_;
  CosTrading::Proxy_var proxy_;
  CosTrading::Admin_var admin_;
};

#endif /* TAO_ATTRIBUTES_H */