Go to the documentation of this file.00001
00002
00003 #ifndef TAO_SEQUENCE_TYPECODE_CPP
00004 #define TAO_SEQUENCE_TYPECODE_CPP
00005
00006 #include "tao/AnyTypeCode/Sequence_TypeCode.h"
00007 #include "tao/CDR.h"
00008 #include "tao/AnyTypeCode/TypeCode_Traits.h"
00009
00010 #ifndef __ACE_INLINE__
00011 # include "tao/AnyTypeCode/Sequence_TypeCode.inl"
00012 #endif
00013
00014 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00015
00016 template <typename TypeCodeType, class RefCountPolicy>
00017 bool
00018 TAO::TypeCode::Sequence<TypeCodeType, RefCountPolicy>::tao_marshal (
00019 TAO_OutputCDR & cdr,
00020 CORBA::ULong offset) const
00021 {
00022
00023
00024
00025
00026
00027
00028 TAO_OutputCDR enc;
00029
00030
00031
00032
00033
00034
00035 offset = ACE_align_binary (offset + 4,
00036 ACE_CDR::OCTET_ALIGN);
00037
00038 return
00039 enc << TAO_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER)
00040 && marshal (enc,
00041 Traits<TypeCodeType>::get_typecode (this->content_type_),
00042 offset + enc.total_length ())
00043 && enc << this->length_
00044 && cdr << static_cast<CORBA::ULong> (enc.total_length ())
00045 && cdr.write_octet_array_mb (enc.begin ());
00046 }
00047
00048 template <typename TypeCodeType, class RefCountPolicy>
00049 void
00050 TAO::TypeCode::Sequence<TypeCodeType, RefCountPolicy>::tao_duplicate (void)
00051 {
00052 this->RefCountPolicy::add_ref ();
00053 }
00054
00055 template <typename TypeCodeType, class RefCountPolicy>
00056 void
00057 TAO::TypeCode::Sequence<TypeCodeType, RefCountPolicy>::tao_release (void)
00058 {
00059 this->RefCountPolicy::remove_ref ();
00060 }
00061
00062 template <typename TypeCodeType, class RefCountPolicy>
00063 CORBA::Boolean
00064 TAO::TypeCode::Sequence<TypeCodeType,
00065 RefCountPolicy>::equal_i (CORBA::TypeCode_ptr tc
00066 ) const
00067 {
00068
00069
00070 CORBA::ULong const tc_length = tc->length ();
00071
00072 if (this->length_ != tc_length)
00073 return 0;
00074
00075 CORBA::TypeCode_var rhs_content_type =
00076 tc->content_type ();
00077
00078 return
00079 Traits<TypeCodeType>::get_typecode (this->content_type_)->equal (
00080 rhs_content_type.in ()
00081 );
00082 }
00083
00084 template <typename TypeCodeType, class RefCountPolicy>
00085 CORBA::Boolean
00086 TAO::TypeCode::Sequence<TypeCodeType,
00087 RefCountPolicy>::equivalent_i (CORBA::TypeCode_ptr tc
00088 ) const
00089 {
00090
00091
00092 CORBA::ULong const tc_length = tc->length ();
00093
00094 if (this->length_ != tc_length)
00095 return 0;
00096
00097 CORBA::TypeCode_var rhs_content_type =
00098 tc->content_type ();
00099
00100 return
00101 Traits<TypeCodeType>::get_typecode (this->content_type_)->equivalent (
00102 rhs_content_type.in ()
00103 );
00104 }
00105
00106 template <typename TypeCodeType, class RefCountPolicy>
00107 CORBA::TypeCode_ptr
00108 TAO::TypeCode::Sequence<TypeCodeType, RefCountPolicy>::get_compact_typecode_i (
00109 void) const
00110 {
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120 CORBA::TypeCode_ptr mutable_tc =
00121 const_cast<TAO::TypeCode::Sequence<TypeCodeType, RefCountPolicy> *> (this);
00122
00123 return CORBA::TypeCode::_duplicate (mutable_tc);
00124 }
00125
00126 template <typename TypeCodeType, class RefCountPolicy>
00127 CORBA::ULong
00128 TAO::TypeCode::Sequence<TypeCodeType, RefCountPolicy>::length_i (
00129 void) const
00130 {
00131 return this->length_;
00132 }
00133
00134 template <typename TypeCodeType, class RefCountPolicy>
00135 CORBA::TypeCode_ptr
00136 TAO::TypeCode::Sequence<TypeCodeType, RefCountPolicy>::content_type_i (
00137 void) const
00138 {
00139 return
00140 CORBA::TypeCode::_duplicate (
00141 Traits<TypeCodeType>::get_typecode (this->content_type_));
00142 }
00143
00144 TAO_END_VERSIONED_NAMESPACE_DECL
00145
00146 #endif