00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef TAO_UNION_TYPECODE_H
00016 #define TAO_UNION_TYPECODE_H
00017
00018 #include "ace/pre.h"
00019
00020 #include "tao/AnyTypeCode/TypeCode.h"
00021
00022 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00023 # pragma once
00024 #endif
00025
00026 #include "tao/AnyTypeCode/TypeCode_Base_Attributes.h"
00027
00028 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00029
00030 namespace TAO
00031 {
00032 namespace TypeCode
00033 {
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 template <typename StringType,
00045 typename TypeCodeType,
00046 class CaseArrayType,
00047 class RefCountPolicy>
00048 class Union
00049 : public CORBA::TypeCode,
00050 private RefCountPolicy
00051 {
00052 public:
00053
00054
00055
00056 typedef TAO::TypeCode::Case<StringType, TypeCodeType> case_type;
00057
00058
00059 Union (char const * id,
00060 char const * name,
00061 #if defined (__BORLANDC__) && (__BORLANDC__ < 0x572)
00062
00063
00064 TypeCodeType discriminant_type,
00065 #else
00066 TypeCodeType const & discriminant_type,
00067 #endif
00068 CaseArrayType const & cases,
00069 CORBA::ULong ncases,
00070 CORBA::Long default_index);
00071
00072
00073 Union (CORBA::TCKind kind, char const * id);
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084 virtual bool tao_marshal (TAO_OutputCDR & cdr,
00085 CORBA::ULong offset) const;
00086 virtual void tao_duplicate (void);
00087 virtual void tao_release (void);
00088
00089
00090 protected:
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100 virtual CORBA::Boolean equal_i (CORBA::TypeCode_ptr tc) const;
00101 virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc
00102 ) const;
00103 virtual CORBA::TypeCode_ptr get_compact_typecode_i (
00104 void) const;
00105 virtual char const * id_i (void) const;
00106 virtual char const * name_i (void) const;
00107 virtual CORBA::ULong member_count_i (void) const;
00108 virtual char const * member_name_i (CORBA::ULong index
00109 ) const;
00110 virtual CORBA::TypeCode_ptr member_type_i (CORBA::ULong index
00111 ) const;
00112 virtual CORBA::Any * member_label_i (CORBA::ULong index
00113 ) const;
00114 virtual CORBA::TypeCode_ptr discriminator_type_i (
00115 void) const;
00116 virtual CORBA::Long default_index_i (void) const;
00117
00118
00119 protected:
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135 Base_Attributes<StringType> base_attributes_;
00136
00137
00138 TypeCodeType discriminant_type_;
00139
00140
00141
00142
00143
00144
00145 CORBA::Long default_index_;
00146
00147
00148
00149 CORBA::ULong ncases_;
00150
00151
00152
00153 CaseArrayType cases_;
00154
00155
00156
00157 };
00158
00159 }
00160 }
00161
00162 TAO_END_VERSIONED_NAMESPACE_DECL
00163
00164
00165 #ifdef __ACE_INLINE__
00166 # include "tao/AnyTypeCode/Union_TypeCode.inl"
00167 #endif
00168
00169 #ifdef ACE_TEMPLATES_REQUIRE_SOURCE
00170 # include "tao/AnyTypeCode/Union_TypeCode.cpp"
00171 #endif
00172
00173 #ifdef ACE_TEMPLATES_REQUIRE_PRAGMA
00174 # pragma implementation ("Union_TypeCode.cpp")
00175 #endif
00176
00177
00178 #include "ace/post.h"
00179
00180 #endif