Go to the documentation of this file.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 template <typename StringType, typename TypeCodeType> class Case;
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045 template <typename StringType,
00046 typename TypeCodeType,
00047 class CaseArrayType,
00048 class RefCountPolicy>
00049 class Union
00050 : public CORBA::TypeCode,
00051 private RefCountPolicy
00052 {
00053 public:
00054
00055
00056
00057 typedef TAO::TypeCode::Case<StringType, TypeCodeType> case_type;
00058
00059
00060 Union (char const * id,
00061 char const * name,
00062 TypeCodeType const & discriminant_type,
00063 CaseArrayType const & cases,
00064 CORBA::ULong ncases,
00065 CORBA::Long default_index);
00066
00067
00068 Union (CORBA::TCKind kind, char const * id);
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079 virtual bool tao_marshal (TAO_OutputCDR & cdr,
00080 CORBA::ULong offset) const;
00081 virtual void tao_duplicate (void);
00082 virtual void tao_release (void);
00083
00084
00085 protected:
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095 virtual CORBA::Boolean equal_i (CORBA::TypeCode_ptr tc) const;
00096 virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc
00097 ) const;
00098 virtual CORBA::TypeCode_ptr get_compact_typecode_i (
00099 void) const;
00100 virtual char const * id_i (void) const;
00101 virtual char const * name_i (void) const;
00102 virtual CORBA::ULong member_count_i (void) const;
00103 virtual char const * member_name_i (CORBA::ULong index
00104 ) const;
00105 virtual CORBA::TypeCode_ptr member_type_i (CORBA::ULong index
00106 ) const;
00107 virtual CORBA::Any * member_label_i (CORBA::ULong index
00108 ) const;
00109 virtual CORBA::TypeCode_ptr discriminator_type_i (
00110 void) const;
00111 virtual CORBA::Long default_index_i (void) const;
00112
00113
00114 protected:
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130 Base_Attributes<StringType> base_attributes_;
00131
00132
00133 TypeCodeType discriminant_type_;
00134
00135
00136
00137
00138
00139
00140 CORBA::Long default_index_;
00141
00142
00143
00144 CORBA::ULong ncases_;
00145
00146
00147
00148 CaseArrayType cases_;
00149
00150
00151
00152 };
00153
00154 }
00155 }
00156
00157 TAO_END_VERSIONED_NAMESPACE_DECL
00158
00159
00160 #ifdef __ACE_INLINE__
00161 # include "tao/AnyTypeCode/Union_TypeCode.inl"
00162 #endif
00163
00164 #ifdef ACE_TEMPLATES_REQUIRE_SOURCE
00165 # include "tao/AnyTypeCode/Union_TypeCode.cpp"
00166 #endif
00167
00168 #ifdef ACE_TEMPLATES_REQUIRE_PRAGMA
00169 # pragma implementation ("Union_TypeCode.cpp")
00170 #endif
00171
00172
00173 #include "ace/post.h"
00174
00175 #endif