summaryrefslogtreecommitdiff
path: root/TAO/tao/corbacom.h
blob: 095b97151e4e4aaa0403140d3dfdde9b9cb741e8 (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
712
// This may look like C, but it's really -*- C++ -*-

// $Id$

// ============================================================================
//
// = LIBRARY
//    TAO
//
// = FILENAME
//    corbacom.h
//
// = DESCRIPTION
//    CORBA C/C++/COM mapping for Win32
//
// = AUTHOR
//     Copyright 1994-1995 by Sun Microsystems Inc. and Andy Gokhale
//     <gokhale@cs.wustl.edu>.
//
// ============================================================================

#if !defined (TAO_CORBACOM_H)
#define TAO_CORBACOM_H

// For some reason, PC compilers don't implement "natural" alignment,
// but only use fixed alignment policies.  The following #pragmas
// configure fixed one-byte alignment policy, since some fixed policy
// needs to apply throughout an ORB.

#if     defined (_MSC_VER)
#       pragma  pack (push, 1)          // VC++, stack 1-byte alignment policy

#       ifdef   _DEBUG                  // convert from VC++ convention ...
#               define  DEBUG           // ... to normal convention
#       endif

#elif   defined (__BORLANDC__)
#       pragma option -a                // BC++, use 1 byte alignment

#endif

#if !defined (TAO_CONST)
//Something to document the fact that we want to put 'const' in front
// of a type, but that it won't turn out the way we want, e.g., we
// really want to express that a CORBA_String is const, but since CORBA_String
// is a char*, the const modifies the pointer and not the pointed-to, and
// some compilers (like SGI's EDG-derived thang) complain.
#define TAO_CONST
#endif /* TAO_CONST */

// Forward declarations of some data types are needed.

class CORBA_Any;
class CORBA_Any_var;
class CORBA_Any_out;
//typedef class CORBA_Any *CORBA_Any_ptr;

class CORBA_TypeCode;
//typedef class CORBA_TypeCode *CORBA_TypeCode_ptr;

class CORBA_POA;
//typedef class CORBA_POA *CORBA_BOA_ptr;

class CORBA_Exception;
//typedef class CORBA_Exception *CORBA_Exception_ptr;

class CORBA_Request;
//typedef class CORBA_Request *CORBA_Request_ptr;

class CORBA_NamedValue;
//typedef class CORBA_NamedValue *CORBA_NamedValue_ptr;

class CORBA_NVList;
//typedef class CORBA_NVList *CORBA_NVList_ptr;

class CORBA_ORB;
//typedef class CORBA_ORB *CORBA_ORB_ptr;

class CORBA_Object;
class CORBA_Object_var;
class CORBA_Object_out;
//typedef class CORBA_Object *CORBA_Object_ptr;

class CORBA_ServerRequest;
//typedef class CORBA_ServerRequest *CORBA_ServerRequest_ptr;

class CORBA_Environment;
//typedef class CORBA_Environment *CORBA_Environment_ptr;

class CORBA_Principal;
//typedef class CORBA_Principal *CORBA_Principal_ptr;

class CORBA_SystemException;
class CORBA_UserException;

// forward declarations of system exceptions
#define TAO_SYSTEM_EXCEPTION(name) class CORBA_ ## name

TAO_SYSTEM_EXCEPTION(UNKNOWN);
TAO_SYSTEM_EXCEPTION(BAD_PARAM);
TAO_SYSTEM_EXCEPTION(NO_MEMORY);
TAO_SYSTEM_EXCEPTION(IMP_LIMIT);
TAO_SYSTEM_EXCEPTION(COMM_FAILURE);
TAO_SYSTEM_EXCEPTION(INV_OBJREF);
TAO_SYSTEM_EXCEPTION(OBJECT_NOT_EXIST);
TAO_SYSTEM_EXCEPTION(NO_PERMISSION);
TAO_SYSTEM_EXCEPTION(INTERNAL);
TAO_SYSTEM_EXCEPTION(MARSHAL);
TAO_SYSTEM_EXCEPTION(INITIALIZE);
TAO_SYSTEM_EXCEPTION(NO_IMPLEMENT);
TAO_SYSTEM_EXCEPTION(BAD_TYPECODE);
TAO_SYSTEM_EXCEPTION(BAD_OPERATION);
TAO_SYSTEM_EXCEPTION(NO_RESOURCES);
TAO_SYSTEM_EXCEPTION(NO_RESPONSE);
TAO_SYSTEM_EXCEPTION(PERSIST_STORE);
TAO_SYSTEM_EXCEPTION(BAD_INV_ORDER);
TAO_SYSTEM_EXCEPTION(TRANSIENT);
TAO_SYSTEM_EXCEPTION(FREE_MEM);
TAO_SYSTEM_EXCEPTION(INV_IDENT);
TAO_SYSTEM_EXCEPTION(INV_FLAG);
TAO_SYSTEM_EXCEPTION(INTF_REPOS);
TAO_SYSTEM_EXCEPTION(BAD_CONTEXT);
TAO_SYSTEM_EXCEPTION(OBJ_ADAPTER);
TAO_SYSTEM_EXCEPTION(DATA_CONVERSION);
#undef TAO_SYSTEM_EXCEPTION

typedef class CORBA_ImplementationDef *
        CORBA_ImplementationDef_ptr;

typedef class CORBA_InterfaceDef *
        CORBA_InterfaceDef_ptr;

// =Forward declarations
struct TAO_Dispatch_Context;
class TAO_Object_Table;
class TAO_Operation_Table;
class TAO_Client_Strategy_Factory;
class TAO_Server_Strategy_Factory;
class TAO_ORB_Parameters;
struct CDR;

// enum values defined in nvlist.h, bitwise ORed.
typedef u_int CORBA_Flags;

template <class T>
struct CORBA_SEQUENCE
  // = TITLE
  //    Utility template class.
  //
  // = DESCRIPTION
{
#if SIZEOF_LONG == 4
  u_long maximum;
  u_long length;
#else
  // = Just assume "int" is four bytes long ...
  u_int maximum;
  u_int length;
#endif /* SIZEOF_LONG */
  T *buffer;
#  if   SIZEOF_BOOL != 0
  bool release;
#  else /* "bool" not builtin to this compiler */
  int  release;
#  endif /* "bool" not builtin */

  CORBA_SEQUENCE (void)
    : maximum (0), length (0), buffer (0) { }

  // XXX destructor should free buffer, elements!!
  ~CORBA_SEQUENCE (void) { }
};

class TAO_Export CORBA
{
  // = TITLE
  //    Provides the CORBA namespace.
  //
  // = DESCRIPTION
  //    This class allows the use of CORBA::Foo, as well as CORBA_Foo
  //    for all standard types Foo.
public:
  // typedef void Status; // g++ doesn't like this
  // return status of operations in a number of standard CORBA classes.

#  if   SIZEOF_BOOL != 0
  typedef bool                  Boolean;
#    define B_FALSE false
#    define B_TRUE true

#  else /* "bool" not builtin to this compiler */
  typedef int                   Boolean;
  enum { B_FALSE = 0, B_TRUE = 1 };
#  endif /* "bool" not builtin */

  typedef Boolean &Boolean_out; // out type for boolean

  typedef u_char Octet;
  typedef Octet  &Octet_out;  // out type for octet

  typedef short Short;
  typedef Short &Short_out;   // out type for short

  typedef u_short UShort;
  typedef UShort &UShort_out; // out type for unsigned short

  // CORBA "Long" (and its unsigned cousin) are 32 bits, just like on
  // almost all C/C++ compilers.

#  if   SIZEOF_LONG == 4
  typedef long Long;
  typedef u_long ULong;
#  else
  // just assume "int" is 4 bytes long ...
  typedef int Long;
  typedef u_int ULong;
#  endif        /* SIZEOF_LONG != 4 */

  // 94-9-32 Appendix A, also the OMG C++ mapping, stipulate that 64
  // bit integers are "LongLong".
  typedef Long &Long_out; // out type for long
  typedef ULong &ULong_out; // out type for unsigned long

  //
  // NOTE:  those are IDL extensions, not yet standard.

#  if   SIZEOF_LONG_LONG == 8
  typedef long long LongLong;
  typedef unsigned long long ULongLong;
#  elif SIZEOF_LONG == 8
  typedef long LongLong;
  typedef u_long ULongLong;
#  elif defined (_MSC_VER) && _MSC_VER >= 900
  typedef __int64 LongLong;
  typedef unsigned __int64 ULongLong;
#  else

  // If "long long" isn't native, programs can't use these data types
  // in normal arithmetic expressions.  If any particular application
  // can cope with the loss of range it can define conversion
  // operators itself.

#    define     NONNATIVE_LONGLONG
#    if defined (TAO_WORDS_BIGENDIAN)
  struct LongLong { Long h, l; };
  struct ULongLong { Long h, l; };
#    else
  struct LongLong { Long l, h; };
  struct ULongLong { ULong l, h; };
#    endif /* !TAO_WORDS_BIGENDIAN */
#  endif /* no native 64 bit integer type */

  typedef LongLong &LongLong_out;  // out type for long long
  typedef ULongLong &ULongLong_out; // out type for unsigned long long

  typedef float Float;
  typedef Float &Float_out; // out type for float

  typedef double Double;
  typedef Double &Double_out; // out type for double

  // 94-9-32 Appendix A defines a 128 bit floating point "long double"
  // data type, with greatly extended precision and four more bits of
  // exponent (compared to "double").
  //
  // NOTE:  that is an IDL extension, not yet standard.

#  if   SIZEOF_LONG_DOUBLE == 16
  typedef long double LongDouble;
#  else
#    define     NONNATIVE_LONGDOUBLE
  struct LongDouble
  {
    char ld[16];
  };
#  endif /* SIZEOF_LONG_DOUBLE != 16 */

  typedef LongDouble &LongDouble_out; // out type for long doubles

  typedef char Char;
  typedef Char &Char_out; // out type for char

  typedef CORBA_SEQUENCE<Octet> OctetSeq;

  typedef Char *String;

  static String string_alloc (ULong len);
  static String string_copy (const Char *);
  static String string_dup (const Char *);
  static void string_free (Char *);

  class TAO_Export String_var
    // = TITLE
    //   String var class. Provides automatic deallocation of storage
    //   for the string once it goes out of scope.
  {
  public:
    String_var (void);
    // default constructor

    String_var (char *p);
    // constructor, owns p

    String_var (const char *p);
    // constructor. Makes a copy of p

    String_var (const String_var &s);
    // copy constructor

    ~String_var (void);
    // destructor

    String_var &operator= (char *p);
    // assignment operator

    String_var &operator= (const char *p);
    // assignment to a const char*. Makes a copy.

    String_var &operator= (const String_var &s);
    // assignment operator

    operator char *();
    // access and modify

    operator const char *() const;
    // only read privileges

    char &operator[] (ULong index);
    // allows access and modification using an index

    char operator[] (ULong index) const;
    // allows only accessing thru an index

    // = in, out, out, and _retn operations.
    // ORBOS/97-05-15, Appendix C.2

    const char *in (void) const;
    // for in parameter

    char *&inout (void);
    // for inout parameter

    char *&out (void);
    // for out parameter

    char *_retn (void);
    // for string of return type

  private:
    char *ptr_;
    // instance.
  };

  // ORBOS/97-05-15, Appendix C.2 defines a String_out class

  class String_out
  {
    //=TITLE
    // String_out
    // =DESCRIPTION
    // To support the memory management for "out" parameter passing mode.

  public:
    // =operations

    String_out (char *&p);
    // construction from a reference to a string

    String_out (String_var &p);
    // construction from a var

    String_out (String_out &s);
    // copy constructor

    String_out &operator= (String_out &s);
    // assignment from a string_out

    String_out &operator= (char *p);
    // assignment from a string

    String_out &operator= (const char *p);
    // assignment from a const string

    operator char *&();
    // cast

    char *&ptr (void);
    // return underlying instance

  private:
    char *&ptr_;
    // instance

    // assignment from _var disallowed
    void operator= (const String_var &);
  };

  // 94-9-32 Appendix A defines 16-bit UNICODE characters as
  // "WChar", and null-terminated strings of them as "WString".
  //
  // NOTE:  those are IDL extensions, not yet standard.

#if defined (ACE_HAS_WCHAR_TYPEDEFS_CHAR)
  typedef short WChar;
#else  /* ! ACE_HAS_WCHAR_TYPEDEFS_CHAR */
  typedef wchar_t WChar;
#endif /* ! ACE_HAS_WCHAR_TYPEDEFS_CHAR */
  typedef WChar *WString;

  typedef WChar &WChar_out; // out type for WChar

  static WString wstring_alloc (ULong len);
  static WString wstring_copy (const WChar *const);
  static WString wstring_dup (const WChar *const);
  static void wstring_free (WChar *const);

  // various CORBA defined classes

  typedef CORBA_Any         Any;
  typedef CORBA_Any_var     Any_var;
  typedef CORBA_Any_out     Any_out;
  typedef Any               *Any_ptr;

  typedef CORBA_POA POA;
  typedef POA *POA_ptr;

  typedef CORBA_Environment Environment;
  typedef Environment *Environment_ptr;

  typedef CORBA_Exception Exception;
  typedef Exception *Exception_ptr;

  typedef CORBA_NamedValue NamedValue;
  typedef NamedValue *NamedValue_ptr;

  typedef CORBA_NVList NVList;
  typedef NVList *NVList_ptr;

  typedef CORBA_Object Object;
  typedef CORBA_Object *Object_ptr;

  typedef CORBA_Principal Principal;
  typedef CORBA_Principal *Principal_ptr;

  typedef CORBA_ORB ORB;
  typedef ORB *ORB_ptr;

  typedef CORBA_Request Request;
  typedef Request *Request_ptr;

  typedef CORBA_ServerRequest ServerRequest;
  typedef ServerRequest *ServerRequest_ptr;

  typedef CORBA_SystemException
  SystemException;

  typedef CORBA_TypeCode TypeCode;
  typedef TypeCode *TypeCode_ptr;

  typedef CORBA_UserException  UserException;

  typedef CORBA_SEQUENCE <TypeCode_ptr> ExceptionList;
  typedef ExceptionList *ExceptionList_ptr;

  typedef CORBA_ImplementationDef *ImplementationDef_ptr;

  typedef class CORBA_InterfaceDef *InterfaceDef_ptr;

  // enum values defined in nvlist.hh, bitwise ORed.
  typedef u_int Flags;

  // Completion Status for System exceptions
  enum CompletionStatus
  {
    COMPLETED_YES,     // successful or exceptional completion
    COMPLETED_NO,      // didn't change any state; retry is OK
    COMPLETED_MAYBE    // can't say what happened; retry unsafe
  };

  // exception type
  enum ExceptionType
  {
    NO_EXCEPTION,
    SYSTEM_EXCEPTION,
    USER_EXCEPTION
  };

  // all the system exception classes
#define TAO_SYSTEM_EXCEPTION(name) \
  typedef CORBA_ ## name      name
  TAO_SYSTEM_EXCEPTION(UNKNOWN);
  TAO_SYSTEM_EXCEPTION(BAD_PARAM);
  TAO_SYSTEM_EXCEPTION(NO_MEMORY);
  TAO_SYSTEM_EXCEPTION(IMP_LIMIT);
  TAO_SYSTEM_EXCEPTION(COMM_FAILURE);
  TAO_SYSTEM_EXCEPTION(INV_OBJREF);
  TAO_SYSTEM_EXCEPTION(OBJECT_NOT_EXIST);
  TAO_SYSTEM_EXCEPTION(NO_PERMISSION);
  TAO_SYSTEM_EXCEPTION(INTERNAL);
  TAO_SYSTEM_EXCEPTION(MARSHAL);
  TAO_SYSTEM_EXCEPTION(INITIALIZE);
  TAO_SYSTEM_EXCEPTION(NO_IMPLEMENT);
  TAO_SYSTEM_EXCEPTION(BAD_TYPECODE);
  TAO_SYSTEM_EXCEPTION(BAD_OPERATION);
  TAO_SYSTEM_EXCEPTION(NO_RESOURCES);
  TAO_SYSTEM_EXCEPTION(NO_RESPONSE);
  TAO_SYSTEM_EXCEPTION(PERSIST_STORE);
  TAO_SYSTEM_EXCEPTION(BAD_INV_ORDER);
  TAO_SYSTEM_EXCEPTION(TRANSIENT);
  TAO_SYSTEM_EXCEPTION(FREE_MEM);
  TAO_SYSTEM_EXCEPTION(INV_IDENT);
  TAO_SYSTEM_EXCEPTION(INV_FLAG);
  TAO_SYSTEM_EXCEPTION(INTF_REPOS);
  TAO_SYSTEM_EXCEPTION(BAD_CONTEXT);
  TAO_SYSTEM_EXCEPTION(OBJ_ADAPTER);
  TAO_SYSTEM_EXCEPTION(DATA_CONVERSION);
#undef TAO_SYSTEM_EXCEPTION

  // = all the CORBA::is_nil methods
  static Boolean is_nil (POA_ptr);
  static Boolean is_nil (Object_ptr);
  static Boolean is_nil (Environment_ptr);
  static Boolean is_nil (NamedValue_ptr);
  static Boolean is_nil (NVList_ptr);
  static Boolean is_nil (Request_ptr);
  //  static Boolean is_nil (Context_ptr);
  static Boolean is_nil (TypeCode_ptr);
  static Boolean is_nil (ORB_ptr);
  static Boolean is_nil (Principal_ptr);
  static Boolean is_nil (ServerRequest_ptr req);

  // = all the CORBA release methods
  static void release (POA_ptr);
  static void release (Object_ptr);
  static void release (Environment_ptr);
  static void release (NamedValue_ptr);
  static void release (NVList_ptr);
  static void release (Request_ptr);
  static void release (Principal_ptr);
  //  static Boolean release (Context_ptr);
  static void release (TypeCode_ptr);
  static void release (ORB_ptr);
  static void release (ServerRequest_ptr req);

  // = Kinds of typecodes.

  // Do not change these enum values, or duplicate them if you need to
  // add values.  They are used to index tables, and if you change the
  // values you'll need to find and update all of those tables.  The
  // values are also part of the Common Data Representation, and hence
  // are part of IIOP and other ORB protocols.

  enum TCKind
  {
    tk_null               = 0,
    tk_void               = 1,
    tk_short              = 2,
    tk_long               = 3,
    tk_ushort             = 4,
    tk_ulong              = 5,
    tk_float              = 6,
    tk_double             = 7,
    tk_boolean            = 8,
    tk_char               = 9,
    tk_octet              = 10,
    tk_any                = 11,
    tk_TypeCode           = 12,
    tk_Principal          = 13,
    tk_objref             = 14,
    tk_struct             = 15,
    tk_union              = 16,
    tk_enum               = 17,
    tk_string             = 18,
    tk_sequence           = 19,
    tk_array              = 20,
    tk_alias              = 21,           // 94-11-7
    tk_except             = 22,           // 94-11-7

    // these five are OMG-IDL data type extensions
    tk_longlong           = 23,           // 94-9-32 Appendix A (+ 2)
    tk_ulonglong          = 24,           // 94-9-32 Appendix A (+ 2)
    tk_longdouble         = 25,           // 94-9-32 Appendix A (+ 2)
    tk_wchar              = 26,           // 94-9-32 Appendix A (+ 2)
    tk_wstring            = 27,           // 94-9-32 Appendix A (+ 2)

    // This symbol is not defined by CORBA 2.0.  It's used to speed up
    // dispatch based on TCKind values, and lets many important ones
    // just be table lookups.  It must always be the last enum value!!

    TC_KIND_COUNT
  };

  // All the typecode constants
  static TypeCode_ptr          _tc_null;
  static TypeCode_ptr          _tc_void;
  static TypeCode_ptr          _tc_short;
  static TypeCode_ptr          _tc_long;
  static TypeCode_ptr          _tc_ushort;
  static TypeCode_ptr          _tc_ulong;
  static TypeCode_ptr          _tc_float;
  static TypeCode_ptr          _tc_double;
  static TypeCode_ptr          _tc_boolean;
  static TypeCode_ptr          _tc_char;
  static TypeCode_ptr          _tc_octet;
  static TypeCode_ptr          _tc_any;
  static TypeCode_ptr          _tc_TypeCode;
  static TypeCode_ptr          _tc_Principal;
  static TypeCode_ptr          _tc_Object;
  static TypeCode_ptr          _tc_struct;
  static TypeCode_ptr          _tc_union;
  static TypeCode_ptr          _tc_enum;
  static TypeCode_ptr          _tc_string;
  static TypeCode_ptr          _tc_sequence;
  static TypeCode_ptr          _tc_array;
  static TypeCode_ptr          _tc_alias;
  static TypeCode_ptr          _tc_except;
  static TypeCode_ptr          _tc_longlong;
  static TypeCode_ptr          _tc_ulonglong;
  static TypeCode_ptr          _tc_longdouble;
  static TypeCode_ptr          _tc_wchar;
  static TypeCode_ptr          _tc_wstring;

  // typecode constants for system exceptions
#define TAO_SYSTEM_EXCEPTION(name) \
  static TypeCode_ptr          _tc_ ## name

  TAO_SYSTEM_EXCEPTION(UNKNOWN);
  TAO_SYSTEM_EXCEPTION(BAD_PARAM);
  TAO_SYSTEM_EXCEPTION(NO_MEMORY);
  TAO_SYSTEM_EXCEPTION(IMP_LIMIT);
  TAO_SYSTEM_EXCEPTION(COMM_FAILURE);
  TAO_SYSTEM_EXCEPTION(INV_OBJREF);
  TAO_SYSTEM_EXCEPTION(OBJECT_NOT_EXIST);
  TAO_SYSTEM_EXCEPTION(NO_PERMISSION);
  TAO_SYSTEM_EXCEPTION(INTERNAL);
  TAO_SYSTEM_EXCEPTION(MARSHAL);
  TAO_SYSTEM_EXCEPTION(INITIALIZE);
  TAO_SYSTEM_EXCEPTION(NO_IMPLEMENT);
  TAO_SYSTEM_EXCEPTION(BAD_TYPECODE);
  TAO_SYSTEM_EXCEPTION(BAD_OPERATION);
  TAO_SYSTEM_EXCEPTION(NO_RESOURCES);
  TAO_SYSTEM_EXCEPTION(NO_RESPONSE);
  TAO_SYSTEM_EXCEPTION(PERSIST_STORE);
  TAO_SYSTEM_EXCEPTION(BAD_INV_ORDER);
  TAO_SYSTEM_EXCEPTION(TRANSIENT);
  TAO_SYSTEM_EXCEPTION(FREE_MEM);
  TAO_SYSTEM_EXCEPTION(INV_IDENT);
  TAO_SYSTEM_EXCEPTION(INV_FLAG);
  TAO_SYSTEM_EXCEPTION(INTF_REPOS);
  TAO_SYSTEM_EXCEPTION(BAD_CONTEXT);
  TAO_SYSTEM_EXCEPTION(OBJ_ADAPTER);
  TAO_SYSTEM_EXCEPTION(DATA_CONVERSION);
#undef  TAO_SYSTEM_EXCEPTION

  static TypeCode_ptr _tc_Bounds;
  static TypeCode_ptr _tc_BadKind;

  static ORB_ptr ORB_init (int &argc,
                           char *const *argv,
                           const char *orb_name,
                           Environment &env);
  // ORB initialisation, per OMG document 94-9-46.

  // Define flags for NVList add methods
  enum
  {
    ARG_IN = 0x01,
    ARG_OUT = 0x02,
    ARG_INOUT = 0x04,
    IN_COPY_VALUE = 0x08,
    OUT_LIST_MEMORY = 0x10
  };
};  // end of class (namespace) CORBA

typedef CORBA::OctetSeq TAO_opaque;
extern CORBA::TypeCode TC_opaque;

typedef void (*TAO_Skeleton)(CORBA::ServerRequest &,
                             void *, // object_ptr
                             void *, // context_ptr
                             CORBA::Environment &);
// signature of a skeleton for every operation of an interface

// COM interface IIDs
extern "C" TAO_Export const TAO_IID IID_CORBA_Any;
extern "C" TAO_Export const TAO_IID IID_BOA;
extern "C" TAO_Export const TAO_IID IID_CORBA_Exception;
extern "C" TAO_Export const TAO_IID IID_CORBA_UserException;
extern "C" TAO_Export const TAO_IID IID_CORBA_SystemException;
extern "C" TAO_Export const TAO_IID IID_CORBA_Request;
extern "C" TAO_Export const TAO_IID IID_CORBA_Object;
extern "C" TAO_Export const TAO_IID IID_CORBA_ORB;
extern "C" TAO_Export const TAO_IID IID_CORBA_NVList;
extern "C" TAO_Export const TAO_IID IID_CORBA_Principal;
extern "C" TAO_Export const TAO_IID IID_CORBA_TypeCode;
extern "C" TAO_Export const TAO_IID IID_CORBA_ServerRequest;
extern "C" TAO_Export const TAO_IID IID_IIOP_ServerRequest;
extern "C" TAO_Export const TAO_IID IID_STUB_Object;
extern "C" TAO_Export const TAO_IID IID_IIOP_Object;
extern "C" TAO_Export const TAO_IID IID_IIOP_ORB;
extern "C" TAO_Export const TAO_IID IID_POA;

// NOTE: stub APIs are nonportable, and must be explicitly #included
// by code emitted from an IDL compiler.

#if     defined (_MSC_VER)
#       pragma pack (pop)               // VC++, goes back to other padding rules
#endif /* VC++ */

// BC++ we leave with 1-byte padding rules...

#endif /* TAO_CORBA_COM_H */