00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Alias_TypeCode.h 00006 * 00007 * $Id: Alias_TypeCode.h 83309 2008-10-17 13:57:39Z johnnyw $ 00008 * 00009 * Header file for a @c tk_alias and @c tk_value_box 00010 * @c CORBA::TypeCode. 00011 * 00012 * @author Ossama Othman <ossama@dre.vanderbilt.edu> 00013 */ 00014 //============================================================================= 00015 00016 #ifndef TAO_ALIAS_TYPECODE_H 00017 #define TAO_ALIAS_TYPECODE_H 00018 00019 #include /**/ "ace/pre.h" 00020 00021 #include "tao/AnyTypeCode/TypeCode.h" 00022 00023 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00024 # pragma once 00025 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00026 00027 #include "tao/TypeCodeFactory_Adapter.h" 00028 #include "tao/AnyTypeCode/TypeCode_Base_Attributes.h" 00029 00030 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00031 00032 namespace TAO 00033 { 00034 namespace TypeCode 00035 { 00036 /** 00037 * @class Alias 00038 * 00039 * @brief @c CORBA::TypeCode implementation for an OMG IDL 00040 * @c typedef. 00041 * 00042 * This class implements a @c CORBA::TypeCode for an OMG IDL 00043 * @c typedef. 00044 */ 00045 template <typename StringType, 00046 typename TypeCodeType, 00047 class RefCountPolicy> 00048 class Alias 00049 : public CORBA::TypeCode, 00050 private RefCountPolicy 00051 { 00052 public: 00053 00054 /// Constructor. 00055 Alias (CORBA::TCKind kind, 00056 char const * id, 00057 char const * name, 00058 TypeCodeType const & tc); 00059 00060 /** 00061 * @name TAO-specific @c CORBA::TypeCode Methods 00062 * 00063 * Methods required by TAO's implementation of the 00064 * @c CORBA::TypeCode class. 00065 * 00066 * @see @c CORBA::TypeCode 00067 */ 00068 //@{ 00069 virtual bool tao_marshal (TAO_OutputCDR & cdr, 00070 CORBA::ULong offset) const; 00071 virtual void tao_duplicate (void); 00072 virtual void tao_release (void); 00073 //@} 00074 00075 protected: 00076 00077 /** 00078 * @name @c TAO CORBA::TypeCode Template Methods 00079 * 00080 * @c tk_alias and @c tk_value_box @c CORBA::TypeCode -specific 00081 * template methods. 00082 * 00083 * @see @c CORBA::TypeCode 00084 */ 00085 //@{ 00086 virtual CORBA::Boolean equal_i (CORBA::TypeCode_ptr tc) const; 00087 virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc) const; 00088 virtual CORBA::TypeCode_ptr get_compact_typecode_i (void) const; 00089 virtual char const * id_i (void) const; 00090 virtual char const * name_i (void) const; 00091 virtual CORBA::TypeCode_ptr content_type_i (void) const; 00092 00093 private: 00094 00095 /// Base attributes for this @c TypeCode containing the 00096 /// repository ID and name of the @c typedef. 00097 Base_Attributes<StringType> attributes_; 00098 00099 /// The @c TypeCode corresponding to the original type upon 00100 /// which the IDL @c typedef was made. 00101 /** 00102 * A pointer to the @c CORBA::TypeCode_ptr rather than the 00103 * @c CORBA::TypeCode_ptr itself is stored since that address is 00104 * well-defined. We may not know the value of the @c 00105 * CORBA::TypeCode_ptr when creating this @c Field statically at 00106 * compile-time, hence the indirection. 00107 * 00108 * @note This @c TypeCode is released upon destruction of this 00109 * @c TypeCode::Alias. 00110 */ 00111 TypeCodeType const content_type_; 00112 00113 }; 00114 00115 } // End namespace TypeCode 00116 } // End namespace TAO 00117 00118 TAO_END_VERSIONED_NAMESPACE_DECL 00119 00120 00121 #ifdef __ACE_INLINE__ 00122 # include "tao/AnyTypeCode/Alias_TypeCode.inl" 00123 #endif /* __ACE_INLINE__ */ 00124 00125 #ifdef ACE_TEMPLATES_REQUIRE_SOURCE 00126 # include "tao/AnyTypeCode/Alias_TypeCode.cpp" 00127 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ 00128 00129 #ifdef ACE_TEMPLATES_REQUIRE_PRAGMA 00130 # pragma implementation ("Alias_TypeCode.cpp") 00131 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ 00132 00133 #include /**/ "ace/post.h" 00134 00135 #endif /* TAO_ALIAS_TYPECODE_H */