00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Sequence_TypeCode_Static.h 00006 * 00007 * $Id: Sequence_TypeCode_Static.h 76551 2007-01-24 13:42:44Z johnnyw $ 00008 * 00009 * Header file for static @c tk_sequence and @c tk_array 00010 * @c CORBA::TypeCodes. 00011 * 00012 * @author Ossama Othman <ossama@dre.vanderbilt.edu> 00013 */ 00014 //============================================================================= 00015 00016 #ifndef TAO_SEQUENCE_TYPECODE_STATIC_H 00017 #define TAO_SEQUENCE_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/Null_RefCount_Policy.h" 00028 00029 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00030 00031 namespace TAO 00032 { 00033 namespace TypeCode 00034 { 00035 template <typename TypeCodeType, class RefCountPolicy> class Sequence; 00036 00037 /** 00038 * @class Sequence 00039 * 00040 * @brief @c CORBA::TypeCode implementation for OMG IDL 00041 * @c sequence and @c array types. 00042 * 00043 * This class implements a @c CORBA::TypeCode for OMG IDL 00044 * @c sequence and array types. 00045 */ 00046 template<> 00047 class TAO_AnyTypeCode_Export Sequence<CORBA::TypeCode_ptr const *, 00048 TAO::Null_RefCount_Policy> 00049 : public CORBA::TypeCode 00050 , private TAO::Null_RefCount_Policy 00051 { 00052 public: 00053 00054 /// Constructor. 00055 Sequence (CORBA::TCKind kind, 00056 CORBA::TypeCode_ptr const * content_type, 00057 CORBA::ULong length); 00058 00059 /** 00060 * @name TAO-specific @c CORBA::TypeCode Methods 00061 * 00062 * Methods required by TAO's implementation of the 00063 * @c CORBA::TypeCode class. 00064 * 00065 * @see @c CORBA::TypeCode 00066 */ 00067 //@{ 00068 virtual bool tao_marshal (TAO_OutputCDR & cdr, 00069 CORBA::ULong offset) const; 00070 virtual void tao_duplicate (void); 00071 virtual void tao_release (void); 00072 //@} 00073 00074 protected: 00075 00076 /** 00077 * @name @c TAO CORBA::TypeCode Template Methods 00078 * 00079 * @c CORBA::TypeCode template methods specific to @c tk_sequence 00080 * @c TypeCodes. 00081 * 00082 * @see @c CORBA::TypeCode 00083 */ 00084 //@{ 00085 virtual CORBA::Boolean equal_i (CORBA::TypeCode_ptr tc 00086 ) const; 00087 virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc 00088 ) const; 00089 virtual CORBA::TypeCode_ptr get_compact_typecode_i ( 00090 void) const; 00091 virtual CORBA::ULong length_i (void) const; 00092 virtual CORBA::TypeCode_ptr content_type_i ( 00093 void) const; 00094 00095 private: 00096 00097 /// Element type of the sequence. 00098 /** 00099 * A pointer to the @c CORBA::TypeCode_ptr rather than the 00100 * @c CORBA::TypeCode_ptr itself is stored since that address is 00101 * well-defined. We may not know the value of the @c 00102 * CORBA::TypeCode_ptr when creating this @c Field statically at 00103 * compile-time, hence the indirection. 00104 * 00105 * @note This @c TypeCode is released upon destruction of this 00106 * @c TypeCode::Sequence. 00107 */ 00108 CORBA::TypeCode_ptr const * const content_type_; 00109 00110 /// Length of the @c sequence or array. A length of zero 00111 /// indicates an unbounded @c sequence. 00112 CORBA::ULong const length_; 00113 00114 }; 00115 00116 } // End namespace TypeCode 00117 } // End namespace TAO 00118 00119 TAO_END_VERSIONED_NAMESPACE_DECL 00120 00121 #ifdef __ACE_INLINE__ 00122 # include "tao/AnyTypeCode/Sequence_TypeCode_Static.inl" 00123 #endif /* __ACE_INLINE__ */ 00124 00125 #include /**/ "ace/post.h" 00126 00127 #endif /* TAO_SEQUENCE_TYPECODE_STATIC_H */