00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Recursive_TypeCode.h 00006 * 00007 * $Id: Recursive_TypeCode.h 89705 2010-03-29 21:15:42Z mitza $ 00008 * 00009 * Header file for a intermediate recursive CORBA::TypeCode. 00010 * 00011 * @author Ossama Othman 00012 */ 00013 //============================================================================= 00014 00015 #ifndef TAO_RECURSIVE_TYPECODE_H 00016 #define TAO_RECURSIVE_TYPECODE_H 00017 00018 #include /**/ "ace/pre.h" 00019 00020 #include "tao/AnyTypeCode/TypeCode.h" 00021 #include "tao/AnyTypeCode/True_RefCount_Policy.h" 00022 00023 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00024 00025 namespace TAO 00026 { 00027 namespace TypeCodeFactory 00028 { 00029 /** 00030 * @class Recursive_TypeCode 00031 * 00032 * @brief Recursive @c TypeCode placeholder. 00033 * 00034 * This class implements a placeholder for recursive TypeCodes. 00035 * It is meant solely for use as an intermediate TypeCode, and 00036 * merely forwards all operations to the actual recursive TypeCode 00037 * that is set by the TypeCodeFactory. 00038 * 00039 * @note This class serves a purpose different than the one served 00040 * by the @c TAO::TypeCode::Recursive class. 00041 */ 00042 class Recursive_TypeCode 00043 : public CORBA::TypeCode, 00044 private TAO::True_RefCount_Policy 00045 { 00046 public: 00047 00048 /// Constructor. 00049 Recursive_TypeCode (char const * id); 00050 00051 /// Set the actual recursive TypeCode to which all TypeCode 00052 /// operations will be forwarded. 00053 void the_typecode (CORBA::TypeCode_ptr tc); 00054 00055 /** 00056 * @name TAO-specific @c CORBA::TypeCode Methods 00057 * 00058 * Methods required by TAO's implementation of the 00059 * @c CORBA::TypeCode class. 00060 * 00061 * @see @c CORBA::TypeCode 00062 */ 00063 //@{ 00064 virtual bool tao_marshal_kind (TAO_OutputCDR & cdr) const; 00065 virtual bool tao_marshal (TAO_OutputCDR &cdr, CORBA::ULong offset) const; 00066 virtual void tao_duplicate (void); 00067 virtual void tao_release (void); 00068 //@} 00069 00070 protected: 00071 00072 /** 00073 * @name TAO @c CORBA::TypeCode Template Methods 00074 * 00075 * Recursive type-capable (i.e. @c struct, @c union, 00076 * @c valuetype and @c eventtype) @c CORBA::TypeCode -specific 00077 * template methods 00078 * 00079 * @see @c CORBA::TypeCode 00080 */ 00081 //@{ 00082 virtual CORBA::Boolean equal_i (CORBA::TypeCode_ptr tc) const; 00083 virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc) const; 00084 virtual CORBA::TypeCode_ptr get_compact_typecode_i (void) const; 00085 virtual char const * id_i (void) const; 00086 virtual char const * name_i (void) const; 00087 virtual CORBA::ULong member_count_i (void) const; 00088 virtual char const * member_name_i (CORBA::ULong index) const; 00089 virtual CORBA::TypeCode_ptr member_type_i (CORBA::ULong index) const; 00090 virtual CORBA::Any * member_label_i (CORBA::ULong index) const; 00091 virtual CORBA::TypeCode_ptr discriminator_type_i (void) const; 00092 virtual CORBA::Long default_index_i (void) const; 00093 virtual CORBA::Visibility member_visibility_i (CORBA::ULong index) const; 00094 virtual CORBA::ValueModifier type_modifier_i (void) const; 00095 virtual CORBA::TypeCode_ptr concrete_base_type_i (void) const; 00096 //@} 00097 00098 private: 00099 00100 /// Repository ID. 00101 CORBA::String_var id_; 00102 00103 /// The actual recursive TypeCode. 00104 /// 00105 /// Originally this was a *_var, but that led to a 00106 /// loop of references meaning the type codes would 00107 /// leak. Keeping a *_ptr to the previous occurrence of 00108 /// type type is safe because whenever we dereference it 00109 /// the target object will exist because it contains this one! 00110 CORBA::TypeCode_ptr the_typecode_; 00111 }; 00112 00113 } // End namespace TypeCodeFactory 00114 } // End namespace TAO 00115 00116 TAO_END_VERSIONED_NAMESPACE_DECL 00117 00118 #ifdef __ACE_INLINE__ 00119 # include "tao/TypeCodeFactory/Recursive_TypeCode.inl" 00120 #endif /* __ACE_INLINE__ */ 00121 00122 #include /**/ "ace/post.h" 00123 00124 #endif /* TAO_RECURSIVE_TYPECODE_H */