summaryrefslogtreecommitdiff
path: root/TAO/tao/Typecode_Constants.cpp
blob: 80850076341e4c9956917fab1a0dc7ba0f702253 (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
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
// $Id$

// ============================================================================
//
// = LIBRARY
//    TAO
//
// = FILENAME
//    Typecode_Constants.cpp
//
// = DESCRIPTION
//   All the CORBA-specified typecode constants.
//
//   NOTE:  IFR TypeCode constants aren't here; they're left for an IDL
//   compiler to generate from the appropriate IDL source.
//
//   NOTE:  it'd be nice to have these not use init sections.  Most can easily
//   be in readonly data (e.g. text segment, ROM) rather than writable data;
//   that speeds program startup and page sharing in shared libraries.
//
//   THREADING NOTE:  no issues, these are immutable constants
//
// = AUTHOR
//     Copyright 1994-1995 by Sun Microsystems Inc.
//     and Aniruddha Gokhale
//
// ============================================================================

#include "tao/Typecode.h"
#include "tao/ORB.h"
#include "tao/GIOP.h"
#include "tao/Object.h"
#include "tao/Object_KeyC.h"
#include "tao/PolicyC.h"
#include "tao/PollableC.h"
#include "tao/CurrentC.h"

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

// Declare all the standard typecodes owned by the ORB

// Null and void
CORBA::TypeCode_ptr CORBA::_tc_null;
CORBA::TypeCode_ptr CORBA::_tc_void;
// Basic numeric types:  short, long, longlong, and unsigned variants
CORBA::TypeCode_ptr CORBA::_tc_short;
CORBA::TypeCode_ptr CORBA::_tc_long;
CORBA::TypeCode_ptr CORBA::_tc_longlong;
CORBA::TypeCode_ptr CORBA::_tc_ushort;
CORBA::TypeCode_ptr CORBA::_tc_ulong;
CORBA::TypeCode_ptr CORBA::_tc_ulonglong;
// Floating point types: single, double, quad precision
CORBA::TypeCode_ptr CORBA::_tc_float;
CORBA::TypeCode_ptr CORBA::_tc_double;
CORBA::TypeCode_ptr CORBA::_tc_longdouble;
// Various simple quantities.
CORBA::TypeCode_ptr CORBA::_tc_boolean;
CORBA::TypeCode_ptr CORBA::_tc_octet;
// Internationalization-related data types: ISO Latin/1 and "wide"
// characters, and strings of each.  "wchar" is probably Unicode 1.1,
// "wstring" being null-terminated sets thereof.
CORBA::TypeCode_ptr CORBA::_tc_char;
CORBA::TypeCode_ptr CORBA::_tc_wchar;
// a string/wstring have a simple parameter list that indicates the length
CORBA::TypeCode_ptr CORBA::_tc_string;
CORBA::TypeCode_ptr CORBA::_tc_wstring;
//
// Various things that can be passed as "general" parameters:
// Any, TypeCode_ptr, Principal_ptr, Object_ptr
//
CORBA::TypeCode_ptr CORBA::_tc_any = 0;
CORBA::TypeCode_ptr CORBA::_tc_TypeCode = 0;
CORBA::TypeCode_ptr CORBA::_tc_Principal = 0;
CORBA::TypeCode_ptr CORBA::_tc_Object = 0;
// Two typecodes for exceptions
CORBA::TypeCode_ptr CORBA::TypeCode::_tc_Bounds = 0;
CORBA::TypeCode_ptr CORBA::TypeCode::_tc_BadKind = 0;
// Some more typecodes in the CORBA namespace. We keep adding to this list as
// we find more and more things being introduced to the CORBA namespace

CORBA::TypeCode_ptr CORBA::_tc_Current = 0;
CORBA::TypeCode_ptr CORBA::_tc_Identifier = 0;
CORBA::TypeCode_ptr CORBA::_tc_RepositoryId = 0;

CORBA::TypeCode_ptr CORBA::_tc_PolicyErrorCode = 0;
CORBA::TypeCode_ptr CORBA::_tc_PolicyError = 0;
CORBA::TypeCode_ptr CORBA::_tc_InvalidPolicies = 0;
CORBA::TypeCode_ptr CORBA::_tc_PolicyType = 0;
CORBA::TypeCode_ptr CORBA::_tc_Policy = 0;
CORBA::TypeCode_ptr CORBA::_tc_PolicyList = 0;
CORBA::TypeCode_ptr CORBA::_tc_PolicyTypeSeq = 0;
CORBA::TypeCode_ptr CORBA::_tc_SetOverrideType = 0;
CORBA::TypeCode_ptr CORBA::_tc_PolicyManager = 0;

CORBA::TypeCode_ptr CORBA::_tc_PollableSet = 0;
CORBA::TypeCode_ptr CORBA::_tc_Pollable = 0;
CORBA::TypeCode_ptr CORBA::_tc_DIIPollable = 0;

// Internal to TAO ORB
CORBA::TypeCode_ptr TC_opaque = 0;
CORBA::TypeCode_ptr TC_ServiceContextList = 0;
CORBA::TypeCode_ptr TC_completion_status = 0;

// initialize all the ORB owned TypeCode constants. This routine will be
// invoked by the ORB_init method
void
TAO_TypeCodes::init (void)
{
  // Initialize all the standard typecodes owned by the ORB

  // Null and void
  CORBA::_tc_null = new CORBA::TypeCode (CORBA::tk_null);

  CORBA::_tc_void = new CORBA::TypeCode (CORBA::tk_void);

  // Basic numeric types:  short, long, longlong, and unsigned variants
  CORBA::_tc_short = new CORBA::TypeCode (CORBA::tk_short);

  CORBA::_tc_long = new CORBA::TypeCode (CORBA::tk_long);

  CORBA::_tc_longlong = new CORBA::TypeCode (CORBA::tk_longlong);

  CORBA::_tc_ushort = new CORBA::TypeCode (CORBA::tk_ushort);

  CORBA::_tc_ulong = new CORBA::TypeCode (CORBA::tk_ulong);

  CORBA::_tc_ulonglong = new CORBA::TypeCode (CORBA::tk_ulonglong);

  // Floating point types: single, double, quad precision
  CORBA::_tc_float = new CORBA::TypeCode (CORBA::tk_float);

  CORBA::_tc_double = new CORBA::TypeCode (CORBA::tk_double);

  CORBA::_tc_longdouble = new CORBA::TypeCode (CORBA::tk_longdouble);

  // Various simple quantities.
  CORBA::_tc_boolean = new CORBA::TypeCode (CORBA::tk_boolean);

  CORBA::_tc_octet = new CORBA::TypeCode (CORBA::tk_octet);

  // Internationalization-related data types: ISO Latin/1 and "wide"
  // characters, and strings of each.  "wchar" is probably Unicode 1.1,
  // "wstring" being null-terminated sets thereof.
  CORBA::_tc_char = new CORBA::TypeCode (CORBA::tk_char);

  CORBA::_tc_wchar = new CORBA::TypeCode (CORBA::tk_wchar);

  // a string/wstring have a simple parameter list that indicates the length
  static const CORBA::Long _oc_string [] =
  {
    // CDR typecode octets
    TAO_ENCAP_BYTE_ORDER, // native endian + padding; "tricky"
    0                     // ... unbounded string
  };
  CORBA::_tc_string = new CORBA::TypeCode (CORBA::tk_string,
                                           sizeof _oc_string,
                                           (char*)&_oc_string,
                                           1,
                                           sizeof (CORBA::String_var));

  static const CORBA::Long _oc_wstring [] =
  {
    // CDR typecode octets
    TAO_ENCAP_BYTE_ORDER,       // native endian + padding; "tricky"
    0                     // ... unbounded string
  };
  CORBA::_tc_wstring = new CORBA::TypeCode (CORBA::tk_wstring,
                                            sizeof _oc_wstring,
                                            (char *) &_oc_wstring,
                                            1,
                                            sizeof (CORBA::WString));

  //
  // Various things that can be passed as "general" parameters:
  // Any, TypeCode_ptr, Principal_ptr, Object_ptr
  //
  CORBA::_tc_any = new CORBA::TypeCode (CORBA::tk_any);

  CORBA::_tc_TypeCode = new CORBA::TypeCode (CORBA::tk_TypeCode);

  CORBA::_tc_Principal = new CORBA::TypeCode (CORBA::tk_Principal);

  // typecode for objref is complex, has two string parameters
  //
  // NOTE:  Must be four-byte aligned

  static const u_char oc_objref [] =
  {
    0, 0, 0, 0,                 // big endian encoding (+ padding)
    0, 0, 0, 29,                  // 29 char string + 3 pad bytes
    'I', 'D', 'L', ':',
    'o', 'm', 'g', '.',
    'o', 'r', 'g', '/',
    'C', 'O', 'R', 'B',
    'A', '/', 'O', 'b',
    'j', 'e', 'c', 't',
    ':', '1', '.', '0',
    '\0', 0, 0, 0,
    0, 0, 0, 7,                 // 7 chars "Object" + 1 pad byte
    'O', 'b', 'j', 'e',
    'c', 't', '\0', 0,
  };

  CORBA::_tc_Object = new CORBA::TypeCode (CORBA::tk_objref,
                                           sizeof oc_objref,
                                           (char *) &oc_objref,
                                           1,
                                           sizeof (CORBA::Object));

  // Static initialization of the two user-defined exceptions that
  // are part of the ORB.

  static char tc_buf_Bounds [] =
  {
    0, 0, 0, 0,           // big endian, padded
    0, 0, 0, 38,  // strlen (id) + 1
    'I', 'D', 'L', ':',
    'o', 'm', 'g', '.',
    'o', 'r', 'g', '/',
    'C', 'O', 'R', 'B',
    'A', '/', 'T', 'y',
    'p', 'e', 'C', 'o',
    'd', 'e', '/', 'B',
    'o', 'u', 'n', 'd',
    's', ':', '1', '.',
    '0', '\0', 0, 0,
    0, 0, 0, 0            // no members to this typecode
  };

  CORBA::TypeCode::_tc_Bounds = new CORBA::TypeCode (CORBA::tk_except,
                                                     sizeof tc_buf_Bounds,
                                                     tc_buf_Bounds,
                                                     1,
                                                     sizeof (CORBA::TypeCode::Bounds));

  static char tc_buf_BadKind [] =
  {
    0, 0, 0, 0,           // big endian, padded
    0, 0, 0, 39,  // strlen (id) + 1
    'I', 'D', 'L', ':',
    'o', 'm', 'g', '.',
    'o', 'r', 'g', '/',
    'C', 'O', 'R', 'B',
    'A', '/', 'T', 'y',
    'p', 'e', 'C', 'o',
    'd', 'e', '/', 'B',
    'a', 'd', 'K', 'i',
    'n', 'd', ':', '1',
    '.', '0', '\0', 0,
    0, 0, 0, 0            // no members to this typecode
  };

  CORBA::TypeCode::_tc_BadKind = new CORBA::TypeCode (CORBA::tk_except,
                                                      sizeof tc_buf_BadKind,
                                                      tc_buf_BadKind,
                                                      1,
                                                      sizeof (CORBA::TypeCode::BadKind));

  static const CORBA::Long _oc_CORBA_Identifier[] =
  {
    TAO_ENCAP_BYTE_ORDER, // byte order
    25, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x434f5242), ACE_NTOHL (0x412f4964), ACE_NTOHL (0x656e7469), ACE_NTOHL (0x66696572), ACE_NTOHL (0x3a312e30), ACE_NTOHL (0xfdfdfd),  // repository ID = IDL:CORBA/Identifier:1.0
    11, ACE_NTOHL (0x4964656e), ACE_NTOHL (0x74696669), ACE_NTOHL (0x657200fd),  // name = Identifier
    CORBA::tk_string,
    0, // string length
  };

  CORBA::_tc_Identifier = new CORBA::TypeCode (CORBA::tk_alias,
                                               sizeof (_oc_CORBA_Identifier),
                                               (char *) &_oc_CORBA_Identifier,
                                               1,
                                               sizeof (CORBA::Identifier));

  static const CORBA::Long _oc_CORBA_RepositoryId[] =
  {
    TAO_ENCAP_BYTE_ORDER, // byte order
    27, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x434f5242), ACE_NTOHL (0x412f5265), ACE_NTOHL (0x706f7369), ACE_NTOHL (0x746f7279), ACE_NTOHL (0x49643a31), ACE_NTOHL (0x2e3000fd),  // repository ID = IDL:CORBA/RepositoryId:1.0
    13, ACE_NTOHL (0x5265706f), ACE_NTOHL (0x7369746f), ACE_NTOHL (0x72794964), ACE_NTOHL (0xfdfdfd),  // name = RepositoryId
    CORBA::tk_string,
    0, // string length
  };
  CORBA::_tc_RepositoryId = new CORBA::TypeCode (CORBA::tk_alias,
                                                 sizeof
                                                 (_oc_CORBA_RepositoryId),
                                                 (char *)
                                                 &_oc_CORBA_RepositoryId,
                                                 1,
                                                 sizeof (CORBA::RepositoryId));

  // ****************************************************************

  static const CORBA::Long _oc_CORBA_PolicyErrorCode[] =
  {
    TAO_ENCAP_BYTE_ORDER, // byte order
    38, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x434f5242), ACE_NTOHL (0x412f506f), ACE_NTOHL (0x6c696379), ACE_NTOHL (0x4572726f), ACE_NTOHL (0x72436f64), ACE_NTOHL (0x653a312e), ACE_NTOHL (0x30000000),  // repository ID = IDL:omg.org/CORBA/PolicyErrorCode:1.0
    16, ACE_NTOHL (0x506f6c69), ACE_NTOHL (0x63794572), ACE_NTOHL (0x726f7243), ACE_NTOHL (0x6f646500),  // name = PolicyErrorCode
    CORBA::tk_short,
  };
  CORBA::_tc_PolicyErrorCode =
    new CORBA::TypeCode (CORBA::tk_alias,
                         sizeof (_oc_CORBA_PolicyErrorCode),
                         (char *) &_oc_CORBA_PolicyErrorCode,
                         0,
                         sizeof (CORBA::PolicyErrorCode));

  static const CORBA::Long _oc_CORBA_PolicyError[] =
  {
  TAO_ENCAP_BYTE_ORDER, // byte order
  34, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x434f5242), ACE_NTOHL (0x412f506f), ACE_NTOHL (0x6c696379), ACE_NTOHL (0x4572726f), ACE_NTOHL (0x723a312e), ACE_NTOHL (0x30000000),  // repository ID = IDL:omg.org/CORBA/PolicyError:1.0
  12, ACE_NTOHL (0x506f6c69), ACE_NTOHL (0x63794572), ACE_NTOHL (0x726f7200),  // name = PolicyError
  1, // member count
    7, ACE_NTOHL (0x72656173), ACE_NTOHL (0x6f6e0000),  // name = reason
    CORBA::tk_alias, // typecode kind for typedefs
    72, // encapsulation length
      TAO_ENCAP_BYTE_ORDER, // byte order
      38, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x434f5242), ACE_NTOHL (0x412f506f), ACE_NTOHL (0x6c696379), ACE_NTOHL (0x4572726f), ACE_NTOHL (0x72436f64), ACE_NTOHL (0x653a312e), ACE_NTOHL (0x30000000),  // repository ID = IDL:omg.org/CORBA/PolicyErrorCode:1.0
      16, ACE_NTOHL (0x506f6c69), ACE_NTOHL (0x63794572), ACE_NTOHL (0x726f7243), ACE_NTOHL (0x6f646500),  // name = PolicyErrorCode
      CORBA::tk_short,
  };
  CORBA::_tc_PolicyError =
    new CORBA::TypeCode(CORBA::tk_except,
                        sizeof (_oc_CORBA_PolicyError),
                        (char *) &_oc_CORBA_PolicyError,
                        0,
                        sizeof (CORBA::PolicyError));

  static const CORBA::Long _oc_CORBA_InvalidPolicies[] =
  {
  TAO_ENCAP_BYTE_ORDER, // byte order
  38, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x434f5242), ACE_NTOHL (0x412f496e), ACE_NTOHL (0x76616c69), ACE_NTOHL (0x64506f6c), ACE_NTOHL (0x69636965), ACE_NTOHL (0x733a312e), ACE_NTOHL (0x30000000),  // repository ID = IDL:omg.org/CORBA/InvalidPolicies:1.0
  16, ACE_NTOHL (0x496e7661), ACE_NTOHL (0x6c696450), ACE_NTOHL (0x6f6c6963), ACE_NTOHL (0x69657300),  // name = InvalidPolicies
  1, // member count
    8, ACE_NTOHL (0x696e6469), ACE_NTOHL (0x63657300),  // name = indices
    CORBA::tk_sequence, // typecode kind
    12, // encapsulation length
      TAO_ENCAP_BYTE_ORDER, // byte order
      CORBA::tk_ushort,

    0,
  };
  CORBA::_tc_InvalidPolicies =
    new CORBA::TypeCode (CORBA::tk_except,
                         sizeof (_oc_CORBA_InvalidPolicies),
                         (char *) &_oc_CORBA_InvalidPolicies,
                         0,
                         sizeof (CORBA::InvalidPolicies));

  static const CORBA::Long _oc_CORBA_PolicyType[] =
  {
  TAO_ENCAP_BYTE_ORDER, // byte order
  33, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x434f5242), ACE_NTOHL (0x412f506f), ACE_NTOHL (0x6c696379), ACE_NTOHL (0x54797065), ACE_NTOHL (0x3a312e30), ACE_NTOHL (0x0),  // repository ID = IDL:omg.org/CORBA/PolicyType:1.0
  11, ACE_NTOHL (0x506f6c69), ACE_NTOHL (0x63795479), ACE_NTOHL (0x70650000),  // name = PolicyType
  CORBA::tk_ulong,
  };
  CORBA::_tc_PolicyType =
    new CORBA::TypeCode (CORBA::tk_alias,
                         sizeof (_oc_CORBA_PolicyType),
                         (char *) &_oc_CORBA_PolicyType,
                         0,
                         sizeof (CORBA::PolicyType));

  static const CORBA::Long _oc_CORBA_Policy[] =
  {
  TAO_ENCAP_BYTE_ORDER, // byte order
  29, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x434f5242), ACE_NTOHL (0x412f506f), ACE_NTOHL (0x6c696379), ACE_NTOHL (0x3a312e30), ACE_NTOHL (0x0),  // repository ID = IDL:omg.org/CORBA/Policy:1.0
  7, ACE_NTOHL (0x506f6c69), ACE_NTOHL (0x63790000),  // name = Policy,
  };
  CORBA::_tc_Policy =
    new CORBA::TypeCode (CORBA::tk_objref,
                         sizeof (_oc_CORBA_Policy),
                         (char *) &_oc_CORBA_Policy,
                         1,
                         sizeof (CORBA::Policy));

  static const CORBA::Long _oc_CORBA_PolicyList[] =
  {
  TAO_ENCAP_BYTE_ORDER, // byte order
  33, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x434f5242), ACE_NTOHL (0x412f506f), ACE_NTOHL (0x6c696379), ACE_NTOHL (0x4c697374), ACE_NTOHL (0x3a312e30), ACE_NTOHL (0x0),  // repository ID = IDL:omg.org/CORBA/PolicyList:1.0
  11, ACE_NTOHL (0x506f6c69), ACE_NTOHL (0x63794c69), ACE_NTOHL (0x73740000),  // name = PolicyList
  CORBA::tk_sequence, // typecode kind
  68, // encapsulation length
    TAO_ENCAP_BYTE_ORDER, // byte order
    CORBA::tk_objref, // typecode kind
    52, // encapsulation length
    TAO_ENCAP_BYTE_ORDER, // byte order
    29, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x434f5242), ACE_NTOHL (0x412f506f), ACE_NTOHL (0x6c696379), ACE_NTOHL (0x3a312e30), ACE_NTOHL (0x0),  // repository ID = IDL:omg.org/CORBA/Policy:1.0
    7, ACE_NTOHL (0x506f6c69), ACE_NTOHL (0x63790000),  // name = Policy,
  0,
  };
 CORBA::_tc_PolicyList =
   new CORBA::TypeCode (CORBA::tk_alias,
                        sizeof (_oc_CORBA_PolicyList),
                        (char *) &_oc_CORBA_PolicyList,
                        1,
                        sizeof (CORBA::PolicyList));

 static const CORBA::Long _oc_CORBA_PolicyTypeSeq[] =
 {
  TAO_ENCAP_BYTE_ORDER, // byte order
  36, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x434f5242), ACE_NTOHL (0x412f506f), ACE_NTOHL (0x6c696379), ACE_NTOHL (0x54797065), ACE_NTOHL (0x5365713a), ACE_NTOHL (0x312e3000),  // repository ID = IDL:omg.org/CORBA/PolicyTypeSeq:1.0
  14, ACE_NTOHL (0x506f6c69), ACE_NTOHL (0x63795479), ACE_NTOHL (0x70655365), ACE_NTOHL (0x71000000),  // name = PolicyTypeSeq
  CORBA::tk_sequence, // typecode kind
  80, // encapsulation length
    TAO_ENCAP_BYTE_ORDER, // byte order
    CORBA::tk_alias, // typecode kind for typedefs
    64, // encapsulation length
      TAO_ENCAP_BYTE_ORDER, // byte order
      33, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x434f5242), ACE_NTOHL (0x412f506f), ACE_NTOHL (0x6c696379), ACE_NTOHL (0x54797065), ACE_NTOHL (0x3a312e30), ACE_NTOHL (0x0),  // repository ID = IDL:omg.org/CORBA/PolicyType:1.0
      11, ACE_NTOHL (0x506f6c69), ACE_NTOHL (0x63795479), ACE_NTOHL (0x70650000),  // name = PolicyType
      CORBA::tk_ulong,

  0,
 };
 CORBA::_tc_PolicyTypeSeq =
   new CORBA::TypeCode (CORBA::tk_alias,
                        sizeof (_oc_CORBA_PolicyTypeSeq),
                        (char *) &_oc_CORBA_PolicyTypeSeq,
                        0,
                        sizeof (CORBA::PolicyTypeSeq));

 static const CORBA::Long _oc_CORBA_SetOverrideType[] =
 {
  TAO_ENCAP_BYTE_ORDER, // byte order
  38, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x434f5242), ACE_NTOHL (0x412f5365), ACE_NTOHL (0x744f7665), ACE_NTOHL (0x72726964), ACE_NTOHL (0x65547970), ACE_NTOHL (0x653a312e), ACE_NTOHL (0x30000000),  // repository ID = IDL:omg.org/CORBA/SetOverrideType:1.0
  16, ACE_NTOHL (0x5365744f), ACE_NTOHL (0x76657272), ACE_NTOHL (0x69646554), ACE_NTOHL (0x79706500),  // name = SetOverrideType
  2, // member count
    13, ACE_NTOHL (0x5345545f), ACE_NTOHL (0x4f564552), ACE_NTOHL (0x52494445), ACE_NTOHL (0x0),  // name = SET_OVERRIDE
    13, ACE_NTOHL (0x4144445f), ACE_NTOHL (0x4f564552), ACE_NTOHL (0x52494445), ACE_NTOHL (0x0),  // name = ADD_OVERRIDE
};
 CORBA::_tc_SetOverrideType =
   new CORBA::TypeCode (CORBA::tk_enum,
                        sizeof (_oc_CORBA_SetOverrideType),
                        (char *) &_oc_CORBA_SetOverrideType,
                        0,
                        sizeof (CORBA::SetOverrideType));

 static const CORBA::Long _oc_CORBA_PolicyManager[] =
 {
  TAO_ENCAP_BYTE_ORDER, // byte order
  36, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x434f5242), ACE_NTOHL (0x412f506f), ACE_NTOHL (0x6c696379), ACE_NTOHL (0x4d616e61), ACE_NTOHL (0x6765723a), ACE_NTOHL (0x312e3000),  // repository ID = IDL:omg.org/CORBA/PolicyManager:1.0
  14, ACE_NTOHL (0x506f6c69), ACE_NTOHL (0x63794d61), ACE_NTOHL (0x6e616765), ACE_NTOHL (0x72000000),  // name = PolicyManager,
 };
 CORBA::_tc_PolicyManager =
   new CORBA::TypeCode (CORBA::tk_objref,
                        sizeof (_oc_CORBA_PolicyManager),
                        (char *) &_oc_CORBA_PolicyManager,
                        0,
                        sizeof (CORBA::PolicyManager));

 static const CORBA::Long _oc_CORBA_PolicyCurrent[] =
 {
  TAO_ENCAP_BYTE_ORDER, // byte order
  36, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x434f5242), ACE_NTOHL (0x412f506f), ACE_NTOHL (0x6c696379), ACE_NTOHL (0x43757272), ACE_NTOHL (0x656e743a), ACE_NTOHL (0x312e3000),  // repository ID = IDL:omg.org/CORBA/PolicyCurrent:1.0
  14, ACE_NTOHL (0x506f6c69), ACE_NTOHL (0x63794375), ACE_NTOHL (0x7272656e), ACE_NTOHL (0x74000000),  // name = PolicyCurrent,
 };
 CORBA::TypeCode_ptr _tc_PolicyCurrent =
   new CORBA::TypeCode  (CORBA::tk_objref,
                         sizeof (_oc_CORBA_PolicyCurrent),
                         (char *) &_oc_CORBA_PolicyCurrent,
                         0,
                         sizeof (CORBA::PolicyCurrent));

 // ****************************************************************

 static const CORBA::Long _oc_CORBA_Pollable[] =
 {
  TAO_ENCAP_BYTE_ORDER, // byte order
  31, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x434f5242), ACE_NTOHL (0x412f506f), ACE_NTOHL (0x6c6c6162), ACE_NTOHL (0x6c653a31), ACE_NTOHL (0x2e300000),  // repository ID = IDL:omg.org/CORBA/Pollable:1.0
  9, ACE_NTOHL (0x506f6c6c), ACE_NTOHL (0x61626c65), ACE_NTOHL (0x0),  // name = Pollable,
 };
 CORBA::_tc_Pollable =
   new CORBA::TypeCode (CORBA::tk_objref,
                        sizeof (_oc_CORBA_Pollable),
                        (char *) &_oc_CORBA_Pollable,
                        0,
                        sizeof (CORBA_Pollable));

 static const CORBA::Long _oc_CORBA_DIIPollable[] =
 {
  TAO_ENCAP_BYTE_ORDER, // byte order
  34, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x434f5242), ACE_NTOHL (0x412f4449), ACE_NTOHL (0x49506f6c), ACE_NTOHL (0x6c61626c), ACE_NTOHL (0x653a312e), ACE_NTOHL (0x30000000),  // repository ID = IDL:omg.org/CORBA/DIIPollable:1.0
  12, ACE_NTOHL (0x44494950), ACE_NTOHL (0x6f6c6c61), ACE_NTOHL (0x626c6500),  // name = DIIPollable,
 };
 CORBA::_tc_DIIPollable =
   new CORBA::TypeCode (CORBA::tk_objref,
                        sizeof (_oc_CORBA_DIIPollable),
                        (char *) &_oc_CORBA_DIIPollable,
                        0,
                        sizeof (CORBA::DIIPollable));

 static const CORBA::Long _oc_CORBA_PollableSet[] =
 {
  TAO_ENCAP_BYTE_ORDER, // byte order
  34, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x434f5242), ACE_NTOHL (0x412f506f), ACE_NTOHL (0x6c6c6162), ACE_NTOHL (0x6c655365), ACE_NTOHL (0x743a312e), ACE_NTOHL (0x30000000),  // repository ID = IDL:omg.org/CORBA/PollableSet:1.0
  12, ACE_NTOHL (0x506f6c6c), ACE_NTOHL (0x61626c65), ACE_NTOHL (0x53657400),  // name = PollableSet,
 };
 CORBA::_tc_PollableSet =
   new CORBA::TypeCode (CORBA::tk_objref, sizeof (_oc_CORBA_PollableSet), (char *) &_oc_CORBA_PollableSet, 0, sizeof (CORBA_PollableSet));

 // ****************************************************************

 static const CORBA::Long _oc_CORBA_Current[] =
 {
  TAO_ENCAP_BYTE_ORDER, // byte order
  22, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x434f5242), ACE_NTOHL (0x412f4375), ACE_NTOHL (0x7272656e), ACE_NTOHL (0x743a312e), ACE_NTOHL (0x3000fdfd),  // repository ID = IDL:CORBA/Current:1.0
  8, ACE_NTOHL (0x43757272), ACE_NTOHL (0x656e7400),  // name = Current,
 };
 CORBA::_tc_Current = new CORBA::TypeCode (CORBA::tk_objref,
                                           sizeof (_oc_CORBA_Current),
                                           (char *) &_oc_CORBA_Current,
                                           1,
                                           sizeof (CORBA::Current));

 // The following are internal to the TAO ORB

  // Octet codes for the parameters of the "Opaque" (sequence of octet)
  // data type used various places internally ... a CDR encapsulation
  // holding two parameters (like all sequence TypeCodes).
  //
  // NOTE: this **MUST** be longword aligned, which is why it's coded as
  // a longword array not an octet array.  Just sticking a long in for
  // padding won't work with compilers that optimize unused data out of
  // existence.

  // CDR typecode octets.

  static const CORBA::Long _oc_opaque [] =
  {

    TAO_ENCAP_BYTE_ORDER,    // native endian + padding; "tricky"
    10,                      // ... (sequence of) octets
    0                        // ... unbounded
  };

  TC_opaque = new CORBA::TypeCode (CORBA::tk_sequence,
                                   sizeof _oc_opaque,
                                   (char *) &_oc_opaque,
                                   1,
                                   sizeof (TAO_opaque));

  // Octet codes for the parameters of the ServiceContextList TypeCode
  // ...  this is a CDR encapsulation holding two parameters (like all
  // sequences): a TypeCode, and the bounds of the sequence (zero in
  // this case).
  //
  // This is complicated since the Typecode for the data type for the
  // sequence members is complex, a structure that nests two further
  // typecodes (one is a sequence).
  //
  // NOTE:  this must be longword aligned!

  static const CORBA::Long _oc_svc_ctx_list [] =
  {
    // START bytes of encapsulation 0
    TAO_ENCAP_BYTE_ORDER, // native endian + padding; "tricky"

    //
    // FIRST sequence param:  typecode for struct is complex,
    // and so uses a nested encapsulation.
    //
    CORBA::tk_struct,
    72, // length of encapsulation 1

    // START bytes of encapsulation 1 (struct params)
    1, // native endian + padding; "tricky"
    1, 0, // type ID omitted:  null string
    1, 0, // name omitted "ServiceContext"

    2, // two struct elements

    // First structure element:  name, typecode for ULong
    //
    // NOTE:  to be more strictly correct this could be a CORBA::tk_alias
    // typecode ...

    1, 0, // name omitted:  "context_id"
    CORBA::tk_long,

    // Second structure element: name, typecode for sequence of octet;
    // the typecode for sequence of octet is complex, there's a second
    // level of nested encapuslation here.

    1, 0, // name omitted:  "context_data"
    CORBA::tk_sequence,   // sequence typecode
    16, // length of encapsulation 2

    // START bytes of encapsulation 2 (sequence params)
    1, // native endian + padding; "tricky"
    1, 0, // type ID omitted:  null string
    CORBA::tk_octet, // (sequence of) octet
    0, // ... unbounded length
    // END bytes of encapsulation 2 (sequence params)

    // END bytes of encapsulation 1 (struct params)

    // SECOND sequence param:  bound of sequence (none)
    0 // unbounded seq of ServiceContext
    // END bytes of encapsulation 0 (sequence params)
  };

  TC_ServiceContextList = new CORBA::TypeCode (CORBA::tk_sequence,
                                               sizeof _oc_svc_ctx_list,
                                               (char *) &_oc_svc_ctx_list,
                                               1,
                                               sizeof (TAO_GIOP_ServiceContextList));

  static const CORBA::ULong oc_completion_status [] =
  {
    TAO_ENCAP_BYTE_ORDER, // byte order flag, tricky
    0, 0,                 // type ID omitted
    3,                    // three members
    0, 0,                 // ... whose names are all omitted
    0, 0,
    0, 0
  };

  TC_completion_status =
    new CORBA::TypeCode (CORBA::tk_enum,
                         sizeof oc_completion_status,
                         (char *) &oc_completion_status,
                         1,
                         sizeof (CORBA::CompletionStatus));
}

// destroy all the typecodes owned by the ORB
void
TAO_TypeCodes::fini (void)
{
  // Initialize all the standard typecodes owned by the ORB

  // Null and void
  CORBA::release (CORBA::_tc_null);

  CORBA::release (CORBA::_tc_void);

  // Basic numeric types:  short, long, longlong, and unsigned variants
  CORBA::release (CORBA::_tc_short);

  CORBA::release (CORBA::_tc_long);

  CORBA::release (CORBA::_tc_longlong);

  CORBA::release (CORBA::_tc_ushort);

  CORBA::release (CORBA::_tc_ulong);

  CORBA::release (CORBA::_tc_ulonglong);

  // Floating point types: single, double, quad precision
  CORBA::release (CORBA::_tc_float);

  CORBA::release (CORBA::_tc_double);

  CORBA::release (CORBA::_tc_longdouble);

  // Various simple quantities.
  CORBA::release (CORBA::_tc_boolean);

  CORBA::release (CORBA::_tc_octet);

  // Internationalization-related data types: ISO Latin/1 and "wide"
  // characters, and strings of each.  "wchar" is probably Unicode 1.1,
  // "wstring" being null-terminated sets thereof.
  CORBA::release (CORBA::_tc_char);

  CORBA::release (CORBA::_tc_wchar);

  // a string/wstring have a simple parameter list that indicates the length
  CORBA::release (CORBA::_tc_string);

  CORBA::release (CORBA::_tc_wstring);

  //
  // Various things that can be passed as "general" parameters:
  // Any, TypeCode_ptr, Principal_ptr, Object_ptr
  //
  CORBA::release (CORBA::_tc_any);

  CORBA::release (CORBA::_tc_TypeCode);

  CORBA::release (CORBA::_tc_Principal);

  // typecode for objref is complex, has two string parameters
  //
  CORBA::release (CORBA::_tc_Object);

  // other ORB owned typecodes
  CORBA::release (CORBA::TypeCode::_tc_Bounds);

  CORBA::release (CORBA::TypeCode::_tc_BadKind);

  // additional typecodes in the CORBA namespace
  CORBA::release (CORBA::_tc_Policy);

  CORBA::release (CORBA::_tc_PolicyList);

  CORBA::release (CORBA::_tc_Current);

  CORBA::release (CORBA::_tc_Identifier);

  CORBA::release (CORBA::_tc_RepositoryId);

  CORBA::release (CORBA::_tc_PolicyType);

  // TAO specific
  CORBA::release (TC_opaque);

  CORBA::release (TC_ServiceContextList);

  CORBA::release (TC_completion_status);
}