Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef TAO_RECURSIVE_TYPE_TYPECODE_H
00017 #define TAO_RECURSIVE_TYPE_TYPECODE_H
00018
00019 #include "ace/pre.h"
00020
00021 #include "tao/AnyTypeCode/ValueModifierC.h"
00022 #include "tao/Basic_Types.h"
00023 #include "tao/Typecode_typesC.h"
00024 #include "ace/Recursive_Thread_Mutex.h"
00025
00026 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00027
00028 namespace TAO
00029 {
00030 namespace TypeCode
00031 {
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045 template <class TypeCodeBase,
00046 typename TypeCodeType,
00047 typename MemberArrayType>
00048 class Recursive_Type
00049 : public TypeCodeBase
00050 {
00051 public:
00052
00053
00054 Recursive_Type (CORBA::TCKind kind,
00055 char const * id,
00056 char const * name,
00057 MemberArrayType const & fields,
00058 CORBA::ULong nfields);
00059
00060
00061 Recursive_Type (char const * id,
00062 char const * name,
00063 TypeCodeType const & discriminant_type,
00064 MemberArrayType const & cases,
00065 CORBA::ULong ncases,
00066 CORBA::Long default_index);
00067
00068
00069 Recursive_Type (CORBA::TCKind kind,
00070 char const * id,
00071 char const * name,
00072 CORBA::ValueModifier modifier,
00073 TypeCodeType const & concrete_base,
00074 MemberArrayType const & fields,
00075 CORBA::ULong nfields);
00076
00077
00078 Recursive_Type (CORBA::TCKind kind,
00079 char const * id);
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095 virtual bool tao_marshal_kind (TAO_OutputCDR & cdr) const;
00096 virtual bool tao_marshal (TAO_OutputCDR & cdr,
00097 CORBA::ULong offset) const;
00098
00099
00100 protected:
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111 virtual CORBA::Boolean equal_i (CORBA::TypeCode_ptr tc) const;
00112 virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc) const;
00113
00114
00115 public:
00116
00117
00118 bool struct_parameters (char const * name,
00119 MemberArrayType const & fields,
00120 CORBA::ULong nfields);
00121
00122
00123 bool union_parameters (
00124 char const * name,
00125 TypeCodeType const & discriminant_type,
00126 MemberArrayType const & cases,
00127 CORBA::ULong ncases,
00128 CORBA::Long default_index);
00129
00130
00131 bool valuetype_parameters (char const * name,
00132 CORBA::ValueModifier modifier,
00133 TypeCodeType const & concrete_base,
00134 MemberArrayType const & fields,
00135 CORBA::ULong nfields);
00136
00137 private:
00138
00139
00140
00141
00142
00143
00144
00145
00146 class Reset
00147 {
00148 public:
00149 Reset (bool & flag) : flag_ (flag) { }
00150 ~Reset (void) { this->flag_ = false; }
00151 private:
00152 bool & flag_;
00153 };
00154
00155 private:
00156
00157
00158 mutable TAO_SYNCH_RECURSIVE_MUTEX lock_;
00159
00160
00161
00162
00163
00164
00165
00166 mutable bool in_recursion_;
00167
00168
00169 bool data_initialized_;
00170 };
00171
00172 }
00173 }
00174
00175 TAO_END_VERSIONED_NAMESPACE_DECL
00176
00177
00178 #ifdef __ACE_INLINE__
00179 # include "tao/AnyTypeCode/Recursive_Type_TypeCode.inl"
00180 #endif
00181
00182 #ifdef ACE_TEMPLATES_REQUIRE_SOURCE
00183 # include "tao/AnyTypeCode/Recursive_Type_TypeCode.cpp"
00184 #endif
00185
00186 #ifdef ACE_TEMPLATES_REQUIRE_PRAGMA
00187 # pragma implementation ("Recursive_Type_TypeCode.cpp")
00188 #endif
00189
00190 #include "ace/post.h"
00191
00192 #endif