summaryrefslogtreecommitdiff
path: root/TAO/tao/PolicyS.cpp
blob: cad124b75a82a4a44daca5600ebee39f555e553f (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
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
// $Id$

/* -*- C++ -*- */

// ******  Code generated by the The ACE ORB (TAO) IDL Compiler *******
// TAO ORB and the TAO IDL Compiler have been developed by Washington
// University Computer Science's Distributed Object Computing Group.
//
// Information on TAO is available at
//                 http://www.cs.wustl.edu/~schmidt/TAO.html

#include "tao/PolicyC.h"
#include "tao/Operation_Table.h"
#include "tao/Server_Request.h"
#include "tao/POA_CORBA.h"

ACE_RCSID(tao, PolicyS, "$Id$")

static const TAO_operation_db_entry CORBA_Policy_operations [] = {
  {"_get_policy_type", &POA_CORBA::Policy::_get_policy_type_skel},
  {"copy", &POA_CORBA::Policy::copy_skel},
  {"destroy", &POA_CORBA::Policy::destroy_skel},
  {"_is_a", &POA_CORBA::Policy::_is_a_skel}
};

static const CORBA::Long _tao_CORBA_Policy_optable_size = sizeof (ACE_Hash_Map_Entry<const char *, TAO_Skeleton>) * (12);
static char _tao_CORBA_Policy_optable_pool [_tao_CORBA_Policy_optable_size];
static ACE_Static_Allocator_Base _tao_CORBA_Policy_allocator (_tao_CORBA_Policy_optable_pool, _tao_CORBA_Policy_optable_size);
TAO_Dynamic_Hash_OpTable tao_CORBA_Policy_optable (CORBA_Policy_operations, 4, 8, &_tao_CORBA_Policy_allocator);
// skeleton constructor
POA_CORBA::Policy::Policy (void)
{
  this->optable_ = &tao_CORBA_Policy_optable;
}

// skeleton destructor
POA_CORBA::Policy::~Policy (void)
{
}
void POA_CORBA::Policy::_get_policy_type_skel (
    CORBA::ServerRequest &_tao_server_request,
    void *_tao_object_reference,
    void * /* context */,
    CORBA::Environment &_tao_orb_environment
)
{
  //  CORBA::Environment _tao_skel_environment;
  static const TAO_Param_Data_Skel _get_CORBA_Policy_policy_type_paramdata [] =
  {
    {CORBA::_tc_PolicyType, 0, 0}
  }; // CORBA_Policy_policy_type_paramdata

  static const TAO_Call_Data_Skel _get_CORBA_Policy_policy_type_calldata =
  {"_get_policy_type", 1, 1, _get_CORBA_Policy_policy_type_paramdata};

  POA_CORBA::Policy *_tao_impl = (POA_CORBA::Policy *)_tao_object_reference;
  CORBA::PolicyType _tao_retval = 0;
  _tao_server_request.demarshal (
    _tao_orb_environment,
    &_get_CORBA_Policy_policy_type_calldata,
    &_tao_retval
  );
  if (_tao_orb_environment.exception ()) return;
  _tao_retval = _tao_impl->policy_type (
    _tao_orb_environment
  );
  _tao_server_request.marshal (
    _tao_orb_environment,
    //    _tao_orb_environment,
    &_get_CORBA_Policy_policy_type_calldata,
    &_tao_retval
  );
}

void POA_CORBA::Policy::copy_skel (
    CORBA::ServerRequest &_tao_server_request,
    void *_tao_object_reference,
    void * /* context */,
    CORBA::Environment &_tao_orb_environment
)
{
  //  CORBA::Environment _tao_skel_environment;
  static const TAO_Param_Data_Skel CORBA_Policy_copy_paramdata [] =
  {
    {CORBA::_tc_Policy, 0, 0}
  }; // CORBA_Policy_copy_paramdata

  static const TAO_Call_Data_Skel CORBA_Policy_copy_calldata =
  {"copy", 1, 1, CORBA_Policy_copy_paramdata};

  POA_CORBA::Policy *_tao_impl = (POA_CORBA::Policy *)_tao_object_reference;
  CORBA::Object_ptr _tao_retval = CORBA::Object::_nil ();
  _tao_server_request.demarshal (
    _tao_orb_environment,
    &CORBA_Policy_copy_calldata,
    &_tao_retval
  );
  if (_tao_orb_environment.exception ()) return;
  _tao_retval = _tao_impl->copy (
    _tao_orb_environment
  );
  _tao_server_request.marshal (
    _tao_orb_environment,
    //    _tao_skel_environment,
    &CORBA_Policy_copy_calldata,
    &_tao_retval
  );
}

void POA_CORBA::Policy::destroy_skel (
    CORBA::ServerRequest &_tao_server_request,
    void *_tao_object_reference,
    void * /* context */,
    CORBA::Environment &_tao_orb_environment
)
{
  //  CORBA::Environment _tao_skel_environment;
  static const TAO_Param_Data_Skel CORBA_Policy_destroy_paramdata [] =
  {
    {CORBA::_tc_void, 0, 0}
  }; // CORBA_Policy_destroy_paramdata

  static const TAO_Call_Data_Skel CORBA_Policy_destroy_calldata =
  {"destroy", 1, 1, CORBA_Policy_destroy_paramdata};

  POA_CORBA::Policy *_tao_impl = (POA_CORBA::Policy *)_tao_object_reference;
  _tao_server_request.demarshal (
    _tao_orb_environment,
    &CORBA_Policy_destroy_calldata,
    0
  );
  if (_tao_orb_environment.exception ()) return;
  _tao_impl->destroy (
    _tao_orb_environment
  );
  _tao_server_request.marshal (
    _tao_orb_environment,
    //    _tao_skel_environment,
    &CORBA_Policy_destroy_calldata,
    0
  );
}

void POA_CORBA::Policy::_is_a_skel (
    CORBA::ServerRequest &_tao_server_request,
    void * _tao_object_reference,
    void * /*context*/,
    CORBA::Environment &_tao_orb_environment
  )
{
  //  CORBA::Environment _tao_skel_environment;
  static const TAO_Param_Data_Skel CORBA_Policy_is_a_paramdata [] =
  {
    {CORBA::_tc_boolean, 0, 0},
    {CORBA::_tc_string, CORBA::ARG_IN, 0}
  };
  static const TAO_Call_Data_Skel CORBA_Policy_is_a_calldata =
  {"_is_a", 1, 2, CORBA_Policy_is_a_paramdata};
  POA_CORBA::Policy_ptr  _tao_impl = (POA_CORBA::Policy_ptr) _tao_object_reference;
  CORBA::Boolean _tao_retval;
  char *_tao_value = 0;
  _tao_server_request.demarshal (
    _tao_orb_environment,
    &CORBA_Policy_is_a_calldata,
    &_tao_retval,
    &_tao_value
  );
  if (_tao_orb_environment.exception () != 0) return;
  _tao_retval = _tao_impl->_is_a (_tao_value, _tao_orb_environment);
  _tao_server_request.marshal (
    _tao_orb_environment,
    //    _tao_skel_environment,
    &CORBA_Policy_is_a_calldata,
    &_tao_retval,
    &_tao_value
  );
  CORBA::string_free (_tao_value);
}

CORBA::Boolean POA_CORBA::Policy::_is_a (
    const char* value,
    CORBA::Environment &_tao_orb_environment
  )
{
  if (
    (!ACE_OS::strcmp ((char *)value, "IDL:CORBA/Policy:1.0")) ||
    (!ACE_OS::strcmp ((char *)value, CORBA::_tc_Object->id (_tao_orb_environment))))
      return 1;
    else
      return 0;
}

void* POA_CORBA::Policy::_downcast (
    const char* logical_type_id
  )
{
  if (ACE_OS::strcmp (logical_type_id, "IDL:CORBA/Policy:1.0") == 0)
    return ACE_static_cast (POA_CORBA::Policy_ptr, this);
  if (ACE_OS::strcmp (logical_type_id, "IDL:omg.org/CORBA/Object:1.0") == 0)
    return ACE_static_cast(PortableServer::Servant, this);
  return 0;
}

void POA_CORBA::Policy::_dispatch (CORBA::ServerRequest &req, void *context, CORBA::Environment &env)
{
  TAO_Skeleton skel; // pointer to skeleton for operation
  const char *opname = req.operation (); // retrieve operation name
  // find the skeleton corresponding to this opname
  if (this->_find (opname, skel) == -1)
  {
    env.exception (new CORBA_BAD_OPERATION (CORBA::COMPLETED_NO));
    ACE_ERROR ((LM_ERROR, "Bad operation <%s>\n", opname));
  }
else
    skel (req, this, context, env);
}

const char* POA_CORBA::Policy::_interface_repository_id (void) const
{
  return "IDL:CORBA/Policy:1.0";
}

POA_CORBA::_tao_collocated_Policy::_tao_collocated_Policy (
    POA_CORBA::Policy_ptr  servant,
    STUB_Object *stub
  )
  : CORBA_Policy (stub, servant, 1),
    CORBA_Object (stub, servant, 1),
    servant_ (servant)
{
}

POA_CORBA::Policy_ptr POA_CORBA::_tao_collocated_Policy::_get_servant (void) const
{
  return this->servant_;
}

CORBA::Boolean POA_CORBA::_tao_collocated_Policy::_is_a (
    const char* logical_type_id,
    CORBA::Environment &_tao_orb_environment
  )
{
  return this->servant_->_is_a (
      logical_type_id,
      _tao_orb_environment
    );
}

CORBA::PolicyType POA_CORBA::_tao_collocated_Policy::policy_type  (
    CORBA::Environment &_tao_orb_environment
   )
{
  return this->servant_->policy_type (
    _tao_orb_environment
  );
}

CORBA::Policy_ptr POA_CORBA::_tao_collocated_Policy::copy  (
    CORBA::Environment &_tao_orb_environment
   )
{
  return this->servant_->copy (
    _tao_orb_environment
  );
}

void POA_CORBA::_tao_collocated_Policy::destroy  (
    CORBA::Environment &_tao_orb_environment
   )
{
  this->servant_->destroy (
    _tao_orb_environment
  );
}


CORBA::Policy*
POA_CORBA::Policy::_this (CORBA_Environment &TAO_IN_ENV)
{
  STUB_Object *stub = this->_create_stub (TAO_IN_ENV);
  if (TAO_IN_ENV.exception () != 0)
    return 0;
  return new POA_CORBA::_tao_collocated_Policy (this, stub);
}