00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Sequence_TypeCode.h 00006 * 00007 * $Id: Sequence_TypeCode.h 83309 2008-10-17 13:57:39Z 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 TypeCodeType const & content_type, 00053 CORBA::ULong length); 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 (TAO_OutputCDR & cdr, CORBA::ULong offset) const; 00065 virtual void tao_duplicate (void); 00066 virtual void tao_release (void); 00067 //@} 00068 00069 protected: 00070 00071 /** 00072 * @name @c TAO CORBA::TypeCode Template Methods 00073 * 00074 * @c CORBA::TypeCode template methods specific to @c tk_sequence 00075 * @c TypeCodes. 00076 * 00077 * @see @c CORBA::TypeCode 00078 */ 00079 //@{ 00080 virtual CORBA::Boolean equal_i (CORBA::TypeCode_ptr tc) const; 00081 virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc) const; 00082 virtual CORBA::TypeCode_ptr get_compact_typecode_i (void) const; 00083 virtual CORBA::ULong length_i (void) const; 00084 virtual CORBA::TypeCode_ptr content_type_i (void) const; 00085 00086 private: 00087 00088 /// Element type of the sequence. 00089 /** 00090 * A pointer to the @c CORBA::TypeCode_ptr rather than the 00091 * @c CORBA::TypeCode_ptr itself is stored since that address is 00092 * well-defined. We may not know the value of the @c 00093 * CORBA::TypeCode_ptr when creating this @c Field statically at 00094 * compile-time, hence the indirection. 00095 * 00096 * @note This @c TypeCode is released upon destruction of this 00097 * @c TypeCode::Sequence. 00098 */ 00099 TypeCodeType const content_type_; 00100 00101 /// Length of the @c sequence or array. A length of zero 00102 /// indicates an unbounded @c sequence. 00103 CORBA::ULong const length_; 00104 00105 }; 00106 00107 } // End namespace TypeCode 00108 } // End namespace TAO 00109 00110 TAO_END_VERSIONED_NAMESPACE_DECL 00111 00112 #ifdef __ACE_INLINE__ 00113 # include "tao/AnyTypeCode/Sequence_TypeCode.inl" 00114 #endif /* __ACE_INLINE__ */ 00115 00116 #ifdef ACE_TEMPLATES_REQUIRE_SOURCE 00117 # include "tao/AnyTypeCode/Sequence_TypeCode.cpp" 00118 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ 00119 00120 #ifdef ACE_TEMPLATES_REQUIRE_PRAGMA 00121 # pragma implementation ("Sequence_TypeCode.cpp") 00122 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ 00123 00124 00125 #include /**/ "ace/post.h" 00126 00127 #endif /* TAO_SEQUENCE_TYPECODE_H */