00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Alias_TypeCode_Static.h 00006 * 00007 * $Id: Alias_TypeCode_Static.h 76947 2007-02-07 20:26:03Z johnnyw $ 00008 * 00009 * Header file for a static @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_STATIC_H 00017 #define TAO_ALIAS_TYPECODE_STATIC_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/AnyTypeCode/TypeCode_Base_Attributes.h" 00028 #include "tao/AnyTypeCode/Null_RefCount_Policy.h" 00029 00030 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00031 00032 namespace TAO 00033 { 00034 namespace TypeCode 00035 { 00036 template <typename StringType, 00037 typename TypeCodeType, 00038 class RefCountPolicy> class Alias; 00039 00040 /** 00041 * @class Alias 00042 * 00043 * @brief @c CORBA::TypeCode implementation for an OMG IDL 00044 * @c typedef. 00045 * 00046 * This class implements a @c CORBA::TypeCode for an OMG IDL 00047 * @c typedef. 00048 */ 00049 template<> 00050 class TAO_AnyTypeCode_Export Alias<char const *, 00051 CORBA::TypeCode_ptr const *, 00052 TAO::Null_RefCount_Policy> 00053 : public CORBA::TypeCode, 00054 private TAO::Null_RefCount_Policy 00055 { 00056 public: 00057 00058 /// Constructor. 00059 Alias (CORBA::TCKind kind, 00060 char const * id, 00061 char const * name, 00062 CORBA::TypeCode_ptr const * tc); 00063 00064 /** 00065 * @name TAO-specific @c CORBA::TypeCode Methods 00066 * 00067 * Methods required by TAO's implementation of the 00068 * @c CORBA::TypeCode class. 00069 * 00070 * @see @c CORBA::TypeCode 00071 */ 00072 //@{ 00073 virtual bool tao_marshal (TAO_OutputCDR & cdr, CORBA::ULong offset) const; 00074 virtual void tao_duplicate (void); 00075 virtual void tao_release (void); 00076 //@} 00077 00078 protected: 00079 00080 /** 00081 * @name @c TAO CORBA::TypeCode Template Methods 00082 * 00083 * @c tk_alias and @c tk_value_box @c CORBA::TypeCode -specific 00084 * template methods. 00085 * 00086 * @see @c CORBA::TypeCode 00087 */ 00088 //@{ 00089 virtual CORBA::Boolean equal_i (CORBA::TypeCode_ptr tc) const; 00090 virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc) const; 00091 virtual CORBA::TypeCode_ptr get_compact_typecode_i (void) const; 00092 virtual char const * id_i (void) const; 00093 virtual char const * name_i (void) const; 00094 virtual CORBA::TypeCode_ptr content_type_i (void) const; 00095 00096 private: 00097 00098 /// Base attributes for this @c TypeCode containing the 00099 /// repository ID and name of the @c typedef. 00100 Base_Attributes<char const *> attributes_; 00101 00102 /// The @c TypeCode corresponding to the original type upon 00103 /// which the IDL @c typedef was made. 00104 /** 00105 * A pointer to the @c CORBA::TypeCode_ptr rather than the 00106 * @c CORBA::TypeCode_ptr itself is stored since that address is 00107 * well-defined. We may not know the value of the @c 00108 * CORBA::TypeCode_ptr when creating this @c Field statically at 00109 * compile-time, hence the indirection. 00110 * 00111 * @note This @c TypeCode is released upon destruction of this 00112 * @c TypeCode::Alias. 00113 */ 00114 CORBA::TypeCode_ptr const * content_type_; 00115 00116 }; 00117 00118 } // End namespace TypeCode 00119 } // End namespace TAO 00120 00121 TAO_END_VERSIONED_NAMESPACE_DECL 00122 00123 00124 #ifdef __ACE_INLINE__ 00125 # include "tao/AnyTypeCode/Alias_TypeCode_Static.inl" 00126 #endif /* __ACE_INLINE__ */ 00127 00128 #include /**/ "ace/post.h" 00129 00130 #endif /* TAO_ALIAS_TYPECODE_STATIC_H */