00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Sequence_TypeCode.h 00006 * 00007 * $Id: Sequence_TypeCode.h 78264 2007-05-04 09:13:12Z johnnyw $ 00008 * 00009 * Header file for @c tk_sequence and @c tk_array @c CORBA::TypeCodes. 00010 * 00011 * @author Ossama Othman <ossama@dre.vanderbilt.edu> 00012 */ 00013 //============================================================================= 00014 00015 #ifndef TAO_SEQUENCE_TYPECODE_H 00016 #define TAO_SEQUENCE_TYPECODE_H 00017 00018 #include /**/ "ace/pre.h" 00019 00020 #include "tao/AnyTypeCode/TypeCode.h" 00021 00022 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00023 # pragma once 00024 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00025 00026 00027 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00028 00029 namespace TAO 00030 { 00031 namespace TypeCode 00032 { 00033 00034 /** 00035 * @class Sequence 00036 * 00037 * @brief @c CORBA::TypeCode implementation for OMG IDL 00038 * @c sequence and @c array types. 00039 * 00040 * This class implements a @c CORBA::TypeCode for OMG IDL 00041 * @c sequence and array types. 00042 */ 00043 template <typename TypeCodeType, class RefCountPolicy> 00044 class Sequence 00045 : public CORBA::TypeCode 00046 , private RefCountPolicy 00047 { 00048 public: 00049 00050 /// Constructor. 00051 Sequence (CORBA::TCKind kind, 00052 #if defined (__BORLANDC__) && (__BORLANDC__ < 0x572) 00053 // Borland C++ currently can't handle a reference to 00054 // const pointer to const CORBA::TypeCode_ptr 00055 TypeCodeType content_type, 00056 #else 00057 TypeCodeType const & content_type, 00058 #endif 00059 CORBA::ULong length); 00060 00061 /** 00062 * @name TAO-specific @c CORBA::TypeCode Methods 00063 * 00064 * Methods required by TAO's implementation of the 00065 * @c CORBA::TypeCode class. 00066 * 00067 * @see @c CORBA::TypeCode 00068 */ 00069 //@{ 00070 virtual bool tao_marshal (TAO_OutputCDR & cdr, 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 CORBA::TypeCode template methods specific to @c tk_sequence 00081 * @c TypeCodes. 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 CORBA::ULong length_i (void) const; 00090 virtual CORBA::TypeCode_ptr content_type_i (void) const; 00091 00092 private: 00093 00094 /// Element type of the sequence. 00095 /** 00096 * A pointer to the @c CORBA::TypeCode_ptr rather than the 00097 * @c CORBA::TypeCode_ptr itself is stored since that address is 00098 * well-defined. We may not know the value of the @c 00099 * CORBA::TypeCode_ptr when creating this @c Field statically at 00100 * compile-time, hence the indirection. 00101 * 00102 * @note This @c TypeCode is released upon destruction of this 00103 * @c TypeCode::Sequence. 00104 */ 00105 TypeCodeType const content_type_; 00106 00107 /// Length of the @c sequence or array. A length of zero 00108 /// indicates an unbounded @c sequence. 00109 CORBA::ULong const length_; 00110 00111 }; 00112 00113 } // End namespace TypeCode 00114 } // End namespace TAO 00115 00116 TAO_END_VERSIONED_NAMESPACE_DECL 00117 00118 #ifdef __ACE_INLINE__ 00119 # include "tao/AnyTypeCode/Sequence_TypeCode.inl" 00120 #endif /* __ACE_INLINE__ */ 00121 00122 #ifdef ACE_TEMPLATES_REQUIRE_SOURCE 00123 # include "tao/AnyTypeCode/Sequence_TypeCode.cpp" 00124 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ 00125 00126 #ifdef ACE_TEMPLATES_REQUIRE_PRAGMA 00127 # pragma implementation ("Sequence_TypeCode.cpp") 00128 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ 00129 00130 00131 #include /**/ "ace/post.h" 00132 00133 #endif /* TAO_SEQUENCE_TYPECODE_H */