summaryrefslogtreecommitdiff
path: root/TAO/tao/PolicyC.cpp
blob: 8b8e2e98392262373ee897d2f6b4e0fe187f7b73 (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
// $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/corba.h"

#if !defined (__ACE_INLINE__)
#include "PolicyC.i"
#endif /* !defined INLINE */

static const CORBA::Long _oc_CORBA_PolicyType[] =
{
  TAO_ENCAP_BYTE_ORDER, // byte order
  25, 0x49444c3a, 0x434f5242, 0x412f506f, 0x6c696379, 0x54797065, 0x3a312e30, 0x0,  // repository ID = IDL:CORBA/PolicyType:1.0
  11, 0x506f6c69, 0x63795479, 0x70650000,  // name = PolicyType
  CORBA::tk_ulong,

};
static CORBA::TypeCode _tc__tc_CORBA_PolicyType (CORBA::tk_alias, sizeof (_oc_CORBA_PolicyType), (char *) &_oc_CORBA_PolicyType, CORBA::B_FALSE);
CORBA::TypeCode_ptr CORBA::_tc_PolicyType = &_tc__tc_CORBA_PolicyType;

CORBA_Policy_ptr CORBA_Policy::_duplicate (CORBA_Policy_ptr obj)
{
  if (!CORBA::is_nil (obj))
    obj->AddRef ();

  return obj;
} // end of _duplicate

CORBA_Policy_ptr CORBA_Policy::_narrow (
    CORBA::Object_ptr obj,
    CORBA::Environment &env
  )
{
  if (CORBA::is_nil (obj))
    return CORBA_Policy::_nil ();
  if (!obj->_is_a ("IDL:CORBA/Policy:1.0", env))
    return CORBA_Policy::_nil ();
  if (!obj->_is_collocated ()
         || !obj->_servant()
         || obj->_servant()->_downcast ("IDL:CORBA/Policy:1.0") == 0
      )
  {
    CORBA_Policy_ptr new_obj = new CORBA_Policy(obj->_get_parent ());
    return new_obj;
  } // end of if
  STUB_Object *stub = obj->_servant ()->_create_stub (env);
  if (env.exception () != 0)
    return CORBA_Policy::_nil ();
  void* servant = obj->_servant ()->_downcast ("IDL:CORBA/Policy:1.0");
  return new POA_CORBA::_tao_collocated_Policy(
      ACE_reinterpret_cast(POA_CORBA::Policy_ptr, servant),
      stub
    );
}

CORBA_Policy_ptr CORBA_Policy::_nil (void)
{
  return (CORBA_Policy_ptr)NULL;
} // end of _nil

CORBA::PolicyType CORBA_Policy::policy_type (
    CORBA::Environment &_tao_environment
   )
{
  static const TAO_Param_Data _get_CORBA_Policy_policy_type_paramdata [] =
  {
    {CORBA::_tc_PolicyType, PARAM_RETURN, 0}
  }; // CORBA_Policy_policy_type_paramdata

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

  CORBA::PolicyType _tao_retval = 0;
  STUB_Object *istub = this->stubobj (_tao_environment);
  if (istub)
  {
    istub->do_static_call (
      _tao_environment,
      &_get_CORBA_Policy_policy_type_calldata,
      &_tao_retval
    );
  } // end of if (istub)
  return _tao_retval;
}

CORBA_Policy_ptr CORBA_Policy::copy (
    CORBA::Environment &_tao_environment
   )
{
  static const TAO_Param_Data CORBA_Policy_copy_paramdata [] =
  {
    {CORBA::_tc_Policy, PARAM_RETURN, 0}
  }; // CORBA_Policy_copy_paramdata

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

  CORBA_Policy_ptr _tao_retval = CORBA_Policy::_nil ();
  STUB_Object *istub = this->stubobj (_tao_environment);
  if (istub)
  {
    CORBA::Object_ptr _tao_base_retval = CORBA::Object::_nil ();
    istub->do_static_call (
      _tao_environment,
      &CORBA_Policy_copy_calldata,
      &_tao_base_retval
    );
    _tao_retval = CORBA_Policy::_narrow (_tao_base_retval, _tao_environment);
    CORBA::release (_tao_base_retval);
  } // end of if (istub)
  return _tao_retval;
}

void CORBA_Policy::destroy (
    CORBA::Environment &_tao_environment
   )
{
  static const TAO_Param_Data CORBA_Policy_destroy_paramdata [] =
  {
    {CORBA::_tc_void, PARAM_RETURN, 0}
  }; // CORBA_Policy_destroy_paramdata

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

  STUB_Object *istub = this->stubobj (_tao_environment);
  if (istub)
  {
    istub->do_static_call (
      _tao_environment,
      &CORBA_Policy_destroy_calldata,
      0
    );
  } // end of if (istub)
  return;
}

CORBA::Boolean CORBA_Policy::_is_a (const CORBA::Char *value, CORBA::Environment &env)
{
  if (
    (!ACE_OS::strcmp ((char *)value, "IDL:CORBA/Policy:1.0")) ||
    (!ACE_OS::strcmp ((char *)value, CORBA::_tc_Object->id (env))))
  return 1; // success using local knowledge
  else
    return this->CORBA_Object::_is_a (value, env); // remote call
}

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

static const CORBA::Long _oc_CORBA_Policy[] =
{
  TAO_ENCAP_BYTE_ORDER, // byte order
  21, 0x49444c3a, 0x434f5242, 0x412f506f, 0x6c696379, 0x3a312e30, 0x0,  // repository ID = IDL:CORBA/Policy:1.0
  7, 0x506f6c69, 0x63790000,  // name = Policy,
};
static CORBA::TypeCode _tc__tc_CORBA_Policy (CORBA::tk_objref, sizeof (_oc_CORBA_Policy), (char *) &_oc_CORBA_Policy, CORBA::B_FALSE);
CORBA::TypeCode_ptr CORBA::_tc_Policy = &_tc__tc_CORBA_Policy;


#if !defined (_CORBA_POLICYLIST_CS_)
#define _CORBA_POLICYLIST_CS_

// *************************************************************
// CORBA_PolicyList
// *************************************************************

CORBA_PolicyList::CORBA_PolicyList (void)
{}
CORBA_PolicyList::CORBA_PolicyList (CORBA::ULong max) // uses max size
  : TAO_Unbounded_Object_Sequence<CORBA_Policy> (max)
{}
CORBA_PolicyList::CORBA_PolicyList (CORBA::ULong max, CORBA::ULong length, CORBA_Policy_ptr *buffer, CORBA::Boolean release)
  : TAO_Unbounded_Object_Sequence<CORBA_Policy> (max, length, buffer, release)
{}
CORBA_PolicyList::CORBA_PolicyList (const CORBA::PolicyList &seq) // copy ctor
  : TAO_Unbounded_Object_Sequence<CORBA_Policy> (seq)
{}
CORBA_PolicyList::~CORBA_PolicyList (void) // dtor
{}

static const CORBA::Long _oc_CORBA_PolicyList_seq[] =
{
    TAO_ENCAP_BYTE_ORDER, // byte order
    CORBA::tk_objref, // typecode kind
    52, // encapsulation length
    TAO_ENCAP_BYTE_ORDER, // byte order
    21, 0x49444c3a, 0x434f5242, 0x412f506f, 0x6c696379, 0x3a312e30, 0x0,  // repository ID = IDL:CORBA/Policy:1.0
    7, 0x506f6c69, 0x63790000,  // name = Policy,
  0,
};
static CORBA::TypeCode _tc__tc_CORBA_PolicyList_seq (CORBA::tk_sequence, sizeof (_oc_CORBA_PolicyList_seq), (char *) &_oc_CORBA_PolicyList_seq, CORBA::B_FALSE);
CORBA::TypeCode_ptr _tc_CORBA_PolicyList_seq = &_tc__tc_CORBA_PolicyList_seq;


#endif /* end #if !defined */

static const CORBA::Long _oc_CORBA_PolicyList[] =
{
  TAO_ENCAP_BYTE_ORDER, // byte order
  25, 0x49444c3a, 0x434f5242, 0x412f506f, 0x6c696379, 0x4c697374, 0x3a312e30, 0x0,  // repository ID = IDL:CORBA/PolicyList:1.0
  11, 0x506f6c69, 0x63794c69, 0x73740000,  // name = PolicyList
  CORBA::tk_sequence, // typecode kind
  60, // encapsulation length
    TAO_ENCAP_BYTE_ORDER, // byte order
    CORBA::tk_objref, // typecode kind
    52, // encapsulation length
    TAO_ENCAP_BYTE_ORDER, // byte order
    21, 0x49444c3a, 0x434f5242, 0x412f506f, 0x6c696379, 0x3a312e30, 0x0,  // repository ID = IDL:CORBA/Policy:1.0
    7, 0x506f6c69, 0x63790000,  // name = Policy,
  0,
};
static CORBA::TypeCode _tc__tc_CORBA_PolicyList (CORBA::tk_alias, sizeof (_oc_CORBA_PolicyList), (char *) &_oc_CORBA_PolicyList, CORBA::B_FALSE);
CORBA::TypeCode_ptr CORBA::_tc_PolicyList = &_tc__tc_CORBA_PolicyList;