TypeCode decorator template.
More...
#include <Recursive_Type_TypeCode.h>
Public Member Functions | |
| Recursive_Type (CORBA::TCKind kind, char const *id, char const *name, MemberArrayType const &fields, CORBA::ULong nfields) | |
Recursive struct constructor. | |
| Recursive_Type (char const *id, char const *name, TypeCodeType const &discriminant_type, MemberArrayType const &cases, CORBA::ULong ncases, CORBA::Long default_index) | |
Recursive union constructor. | |
| Recursive_Type (CORBA::TCKind kind, char const *id, char const *name, CORBA::ValueModifier modifier, TypeCodeType const &concrete_base, MemberArrayType const &fields, CORBA::ULong nfields) | |
Recursive valuetype constructor. | |
| Recursive_Type (CORBA::TCKind kind, char const *id) | |
Dynamic Recursive_Type TypeCode constructor. | |
| void | struct_parameters (char const *name, MemberArrayType const &fields, CORBA::ULong nfields) |
Set struct TypeCode parameters. | |
| void | union_parameters (char const *name, TypeCodeType const &discriminant_type, MemberArrayType const &cases, CORBA::ULong ncases, CORBA::Long default_index) |
Set union TypeCode parameters. | |
| void | valuetype_parameters (char const *name, CORBA::ValueModifier modifier, TypeCodeType const &concrete_base, MemberArrayType const &fields, CORBA::ULong nfields) |
Set valuetype or eventtype TypeCode parameters. | |
TAO-specific @c CORBA::TypeCode Methods | |
Methods required by TAO's implementation of the CORBA::TypeCode class.
TypeCode marshaling operation overrides.
| |
| virtual bool | tao_marshal_kind (TAO_OutputCDR &cdr) const |
| virtual bool | tao_marshal (TAO_OutputCDR &cdr, CORBA::ULong offset) const |
Protected Member Functions | |
TAO @c CORBA::TypeCode Template Methods | |
| virtual CORBA::Boolean | equal_i (CORBA::TypeCode_ptr tc) const |
| virtual CORBA::Boolean | equivalent_i (CORBA::TypeCode_ptr tc) const |
Private Attributes | |
| TAO_SYNCH_RECURSIVE_MUTEX | lock_ |
| Internal state thread synchronization mutex. | |
| bool | in_recursion_ |
Classes | |
| class | Reset |
| Reset flag to false in an exception-safe manner. More... | |
TypeCode decorator template.
This class template decorates the underlying TypeCode implementation TypeCodeBase to provide support for IDL defined recursive types. Only IDL an struct, union or valuetype may be recursive, which is why this decorator only supports constructors for the corresponding TypeCode implementations.
Definition at line 47 of file Recursive_Type_TypeCode.h.
| TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE TAO::TypeCode::Recursive_Type< TypeCodeBase, TypeCodeType, MemberArrayType >::Recursive_Type | ( | CORBA::TCKind | kind, | |
| char const * | id, | |||
| char const * | name, | |||
| MemberArrayType const & | fields, | |||
| CORBA::ULong | nfields | |||
| ) |
Recursive struct constructor.
Definition at line 11 of file Recursive_Type_TypeCode.inl.
00017 : TypeCodeBase (kind, id, name, fields, nfields) 00018 , lock_ () 00019 , in_recursion_ (false) 00020 { 00021 // ACE_ASSERT (kind != CORBA::tk_except); 00022 }
| ACE_INLINE TAO::TypeCode::Recursive_Type< TypeCodeBase, TypeCodeType, MemberArrayType >::Recursive_Type | ( | char const * | id, | |
| char const * | name, | |||
| TypeCodeType const & | discriminant_type, | |||
| MemberArrayType const & | cases, | |||
| CORBA::ULong | ncases, | |||
| CORBA::Long | default_index | |||
| ) |
Recursive union constructor.
Definition at line 28 of file Recursive_Type_TypeCode.inl.
00039 : TypeCodeBase (id, 00040 name, 00041 discriminant_type, 00042 cases, 00043 ncases, 00044 default_index) 00045 , lock_ () 00046 , in_recursion_ (false) 00047 { 00048 }
| ACE_INLINE TAO::TypeCode::Recursive_Type< TypeCodeBase, TypeCodeType, MemberArrayType >::Recursive_Type | ( | CORBA::TCKind | kind, | |
| char const * | id, | |||
| char const * | name, | |||
| CORBA::ValueModifier | modifier, | |||
| TypeCodeType const & | concrete_base, | |||
| MemberArrayType const & | fields, | |||
| CORBA::ULong | nfields | |||
| ) |
Recursive valuetype constructor.
Definition at line 54 of file Recursive_Type_TypeCode.inl.
00066 : TypeCodeBase (kind, 00067 id, 00068 name, 00069 modifier, 00070 concrete_base, 00071 fields, 00072 nfields) 00073 , lock_ () 00074 , in_recursion_ (false) 00075 { 00076 }
| ACE_INLINE TAO::TypeCode::Recursive_Type< TypeCodeBase, TypeCodeType, MemberArrayType >::Recursive_Type | ( | CORBA::TCKind | kind, | |
| char const * | id | |||
| ) |
Dynamic Recursive_Type TypeCode constructor.
Definition at line 82 of file Recursive_Type_TypeCode.inl.
00085 : TypeCodeBase (kind, id) 00086 , lock_ () 00087 , in_recursion_ (false) 00088 { 00089 // ACE_ASSERT (kind == CORBA::tk_struct 00090 // || kind == CORBA::tk_union 00091 // || kind == CORBA::tk_value 00092 // || kind == CORBA::tk_event); 00093 }
| CORBA::Boolean TAO::TypeCode::Recursive_Type< TypeCodeBase, TypeCodeType, MemberArrayType >::equal_i | ( | CORBA::TypeCode_ptr | tc | ) | const [protected, virtual] |
Definition at line 59 of file Recursive_Type_TypeCode.cpp.
References ACE_GUARD_RETURN, and TAO_SYNCH_RECURSIVE_MUTEX.
00061 { 00062 ACE_GUARD_RETURN (TAO_SYNCH_RECURSIVE_MUTEX, 00063 guard, 00064 this->lock_, 00065 false); 00066 00067 // Top-level TypeCode case. 00068 if (!(this->in_recursion_)) 00069 { 00070 this->in_recursion_ = true; 00071 00072 // Reset recursion flag to false in an exception-safe manner once 00073 // equality determination is done. 00074 // 00075 // Only reset the recursion flag at the top-level. 00076 Reset flag (this->in_recursion_); 00077 00078 return this->TypeCodeBase::equal_i (tc); 00079 } 00080 00081 // Nothing else to do. 00082 return true; 00083 }
| CORBA::Boolean TAO::TypeCode::Recursive_Type< TypeCodeBase, TypeCodeType, MemberArrayType >::equivalent_i | ( | CORBA::TypeCode_ptr | tc | ) | const [protected, virtual] |
Definition at line 89 of file Recursive_Type_TypeCode.cpp.
References ACE_GUARD_RETURN, and TAO_SYNCH_RECURSIVE_MUTEX.
00091 { 00092 ACE_GUARD_RETURN (TAO_SYNCH_RECURSIVE_MUTEX, 00093 guard, 00094 this->lock_, 00095 false); 00096 00097 // Top-level TypeCode case. 00098 if (!(this->in_recursion_)) 00099 { 00100 this->in_recursion_ = true; 00101 00102 // Reset recursion flag to false in an exception-safe manner once 00103 // equivalence determination is done. 00104 // 00105 // Only reset the recursion flag at the top-level. 00106 Reset flag (this->in_recursion_); 00107 00108 return this->TypeCodeBase::equivalent_i (tc); 00109 } 00110 00111 // Nothing else to do. 00112 return true; 00113 }
| ACE_INLINE void TAO::TypeCode::Recursive_Type< TypeCodeBase, TypeCodeType, MemberArrayType >::struct_parameters | ( | char const * | name, | |
| MemberArrayType const & | fields, | |||
| CORBA::ULong | nfields | |||
| ) |
Set struct TypeCode parameters.
Definition at line 99 of file Recursive_Type_TypeCode.inl.
00103 { 00104 this->base_attributes_.name (name); 00105 this->fields_ = fields; 00106 this->nfields_ = nfields; 00107 }
| TAO_BEGIN_VERSIONED_NAMESPACE_DECL bool TAO::TypeCode::Recursive_Type< TypeCodeBase, TypeCodeType, MemberArrayType >::tao_marshal | ( | TAO_OutputCDR & | cdr, | |
| CORBA::ULong | offset | |||
| ) | const [virtual] |
Definition at line 15 of file Recursive_Type_TypeCode.cpp.
References ACE_GUARD_RETURN, and TAO_SYNCH_RECURSIVE_MUTEX.
00018 { 00019 ACE_GUARD_RETURN (TAO_SYNCH_RECURSIVE_MUTEX, 00020 guard, 00021 this->lock_, 00022 false); 00023 00024 // Top-level TypeCode case. 00025 if (!(this->in_recursion_)) 00026 { 00027 this->in_recursion_ = true; 00028 00029 // Starting offset should point to the CORBA::TCKind value. 00030 00031 // Note that this doesn't need to take into account alignment 00032 // padding since CORBA::TCKind (encoded as a CORBA::ULong) is 00033 // already aligned on the appropriate boundary, and since the 00034 // CORBA::TCKind was the last thing marshaled into the CDR 00035 // stream before getting here. 00036 offset = sizeof (CORBA::ULong); 00037 00038 // Reset recursion flag to false in an exception-safe manner once 00039 // marshaling is done. 00040 // 00041 // Only reset the recursion flag at the top-level. 00042 Reset flag (this->in_recursion_); 00043 00044 return this->TypeCodeBase::tao_marshal (cdr, offset); 00045 } 00046 00047 // Recursive/indirected TypeCode case. 00048 00049 // ACE_ASSERT (offset > 4 00050 // && offset < static_cast<CORBA::ULong> (ACE_INT32_MAX)); 00051 00052 return (cdr << -static_cast<CORBA::Long> (offset)); 00053 }
| bool TAO::TypeCode::Recursive_Type< TypeCodeBase, TypeCodeType, MemberArrayType >::tao_marshal_kind | ( | TAO_OutputCDR & | cdr | ) | const [virtual] |
Definition at line 119 of file Recursive_Type_TypeCode.cpp.
References ACE_GUARD_RETURN, CORBA::TypeCode::tao_marshal_kind(), and TAO_SYNCH_RECURSIVE_MUTEX.
00121 { 00122 ACE_GUARD_RETURN (TAO_SYNCH_RECURSIVE_MUTEX, 00123 guard, 00124 this->lock_, 00125 false); 00126 00127 // Top-level TypeCode case. 00128 if (!(this->in_recursion_)) 00129 return this->::CORBA::TypeCode::tao_marshal_kind (cdr); 00130 00131 // Recursive/indirected TypeCode case. 00132 CORBA::ULong const indirection_kind = 0xffffffff; 00133 00134 return (cdr << indirection_kind); 00135 }
| ACE_INLINE void TAO::TypeCode::Recursive_Type< TypeCodeBase, TypeCodeType, MemberArrayType >::union_parameters | ( | char const * | name, | |
| TypeCodeType const & | discriminant_type, | |||
| MemberArrayType const & | cases, | |||
| CORBA::ULong | ncases, | |||
| CORBA::Long | default_index | |||
| ) |
Set union TypeCode parameters.
Definition at line 113 of file Recursive_Type_TypeCode.inl.
00123 { 00124 this->base_attributes_.name (name); 00125 this->discriminant_type_ = discriminant_type; 00126 this->cases_ = cases; 00127 this->ncases_ = ncases; 00128 this->default_index_ = default_index; 00129 }
| ACE_INLINE void TAO::TypeCode::Recursive_Type< TypeCodeBase, TypeCodeType, MemberArrayType >::valuetype_parameters | ( | char const * | name, | |
| CORBA::ValueModifier | modifier, | |||
| TypeCodeType const & | concrete_base, | |||
| MemberArrayType const & | fields, | |||
| CORBA::ULong | nfields | |||
| ) |
Set valuetype or eventtype TypeCode parameters.
Definition at line 135 of file Recursive_Type_TypeCode.inl.
00145 { 00146 this->base_attributes_.name (name); 00147 this->type_modifier_ = modifier; 00148 this->concrete_base_ = concrete_base; 00149 this->fields_ = fields; 00150 this->nfields_ = nfields; 00151 }
bool TAO::TypeCode::Recursive_Type< TypeCodeBase, TypeCodeType, MemberArrayType >::in_recursion_ [mutable, private] |
This flag is used to prevent TypeCode equality and equivalence operations from recursing indefinitely.
Definition at line 193 of file Recursive_Type_TypeCode.h.
TAO_SYNCH_RECURSIVE_MUTEX TAO::TypeCode::Recursive_Type< TypeCodeBase, TypeCodeType, MemberArrayType >::lock_ [mutable, private] |
Internal state thread synchronization mutex.
Definition at line 185 of file Recursive_Type_TypeCode.h.
1.4.7