Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Sequence_T.cpp

Go to the documentation of this file.
00001 // $Id: Sequence_T.cpp,v 1.1.1.4.2.1 2003/03/26 18:26:17 taoadmin Exp $
00002 
00003 #ifndef TAO_SEQUENCE_T_C
00004 #define TAO_SEQUENCE_T_C
00005 
00006 #include "tao/Sequence_T.h"
00007 #include "tao/Environment.h"
00008 
00009 #if !defined (__ACE_INLINE__)
00010 #include "tao/Sequence_T.i"
00011 #endif /* __ACE_INLINE__ */
00012 
00013 ACE_RCSID (tao, 
00014            Sequence_T, 
00015            "$Id: Sequence_T.cpp,v 1.1.1.4.2.1 2003/03/26 18:26:17 taoadmin Exp $")
00016 
00017 template <class T>
00018 TAO_Unbounded_Sequence<T>::TAO_Unbounded_Sequence (
00019     const TAO_Unbounded_Sequence<T> &rhs
00020   )
00021   : TAO_Unbounded_Base_Sequence (rhs)
00022 {
00023   if (rhs.buffer_ != 0)
00024     {
00025       T *tmp1 = TAO_Unbounded_Sequence<T>::allocbuf (this->maximum_);
00026       T * const tmp2 =
00027         ACE_reinterpret_cast (T * ACE_CAST_CONST, rhs.buffer_);
00028 
00029       for (CORBA::ULong i = 0; i < this->length_; ++i)
00030         {
00031           tmp1[i] = tmp2[i];
00032         }
00033 
00034       this->buffer_ = tmp1;
00035     }
00036   else
00037     {
00038       this->buffer_ = 0;
00039     }
00040 }
00041 
00042 template <class T> TAO_Unbounded_Sequence<T> &
00043 TAO_Unbounded_Sequence<T>::operator= (const TAO_Unbounded_Sequence<T> &rhs)
00044 {
00045   if (this == &rhs)
00046     {
00047       return *this;
00048     }
00049 
00050   if (this->release_)
00051     {
00052       if (this->maximum_ < rhs.maximum_)
00053         {
00054           // Free the old buffer.
00055           T *tmp = ACE_reinterpret_cast (T *,
00056                                          this->buffer_);
00057           TAO_Unbounded_Sequence<T>::freebuf (tmp);
00058           this->buffer_ =
00059             TAO_Unbounded_Sequence<T>::allocbuf (rhs.maximum_);
00060         }
00061     }
00062   else
00063     {
00064       if (rhs.maximum_ == 0)
00065         {
00066           this->buffer_ = 0;
00067         }
00068       else
00069         {
00070           this->buffer_ =
00071             TAO_Unbounded_Sequence<T>::allocbuf (rhs.maximum_);
00072         }
00073     }
00074 
00075   TAO_Unbounded_Base_Sequence::operator= (rhs);
00076 
00077   T *tmp1 = ACE_reinterpret_cast (T *, 
00078                                   this->buffer_);
00079   T * const tmp2 = ACE_reinterpret_cast (T * ACE_CAST_CONST, 
00080                                          rhs.buffer_);
00081 
00082   for (CORBA::ULong i = 0; i < this->length_; ++i)
00083     {
00084       tmp1[i] = tmp2[i];
00085     }
00086 
00087   return *this;
00088 }
00089 
00090 template<class T>
00091 TAO_Unbounded_Sequence<T>::~TAO_Unbounded_Sequence (void)
00092 {
00093   this->_deallocate_buffer ();
00094 }
00095 
00096 template<class T> void
00097 TAO_Unbounded_Sequence<T>::_allocate_buffer (CORBA::ULong length)
00098 {
00099   T* tmp = TAO_Unbounded_Sequence<T>::allocbuf (length);
00100 
00101   if (this->buffer_ != 0)
00102     {
00103       T *old = ACE_reinterpret_cast (T *,
00104                                      this->buffer_);
00105 
00106       for (CORBA::ULong i = 0; i < this->length_; ++i)
00107         {
00108           tmp[i] = old[i];
00109         }
00110 
00111       if (this->release_)
00112         {
00113           TAO_Unbounded_Sequence<T>::freebuf (old);
00114         }
00115     }
00116 
00117   this->buffer_ = tmp;
00118 }
00119 
00120 template<class T> void
00121 TAO_Unbounded_Sequence<T>::_deallocate_buffer (void)
00122 {
00123   if (this->release_ == 0)
00124     {
00125       return;
00126     }
00127 
00128   T *tmp = ACE_reinterpret_cast (T *,
00129                                  this->buffer_);
00130 
00131   TAO_Unbounded_Sequence<T>::freebuf (tmp);
00132   this->buffer_ = 0;
00133 }
00134 
00135 // The following function is not inline, to avoid build (template
00136 // instantiation) problems with Sun C++ 4.2 patch 104631-07/SunOS 5.6.
00137 template <class T> T &
00138 TAO_Unbounded_Sequence<T>::operator[] (CORBA::ULong i)
00139 {
00140   ACE_ASSERT (i < this->maximum_);
00141   T* tmp = ACE_reinterpret_cast (T *,
00142                                  this->buffer_);
00143   ACE_ASSERT (tmp != 0);
00144   return tmp[i];
00145 }
00146 
00147 // The following function is not inline, to avoid build (template
00148 // instantiation) problems with Sun C++ 4.2 patch 104631-07/SunOS 5.6.
00149 template <class T> const T &
00150 TAO_Unbounded_Sequence<T>::operator[] (CORBA::ULong i) const
00151 {
00152   ACE_ASSERT (i < this->maximum_);
00153   T * const tmp = ACE_reinterpret_cast (T* ACE_CAST_CONST, 
00154                                         this->buffer_);
00155   ACE_ASSERT (tmp != 0);
00156   return tmp[i];
00157 }
00158 
00159 // ****************************************************************
00160 // Bounded_Sequence
00161 // ****************************************************************
00162 
00163 template <class T, size_t MAX>
00164 TAO_Bounded_Sequence<T, MAX>::TAO_Bounded_Sequence (
00165     const TAO_Bounded_Sequence<T, MAX> &rhs
00166   )
00167   : TAO_Bounded_Base_Sequence (rhs)
00168 {
00169   if (rhs.buffer_ != 0)
00170     {
00171       T *tmp1 = TAO_Bounded_Sequence<T, MAX>::allocbuf (MAX);
00172 
00173       T * const tmp2 =
00174         ACE_reinterpret_cast (T * ACE_CAST_CONST, 
00175                               rhs.buffer_);
00176 
00177       for (CORBA::ULong i = 0; i < this->length_; ++i)
00178         {
00179           tmp1[i] = tmp2[i];
00180         }
00181 
00182       this->buffer_ = tmp1;
00183     }
00184   else
00185     {
00186       this->buffer_ = 0;
00187     }
00188 }
00189 
00190 template <class T, size_t MAX> TAO_Bounded_Sequence<T, MAX> &
00191 TAO_Bounded_Sequence<T, MAX>::operator= (
00192     const TAO_Bounded_Sequence<T, MAX> &rhs
00193   )
00194 {
00195   if (this == &rhs)
00196     {
00197       return *this;
00198     }
00199 
00200   if (this->release_)
00201     {
00202       // We never need to reallocate the buffer because they are
00203       // always of size MAX.
00204     }
00205   else
00206     {
00207       if (rhs.maximum_ == 0)
00208         {
00209           this->buffer_ = 0;
00210         }
00211       else
00212         {
00213           this->buffer_ =
00214             TAO_Bounded_Sequence<T, MAX>::allocbuf (rhs.maximum_);
00215         }
00216     }
00217 
00218   TAO_Bounded_Base_Sequence::operator= (rhs);
00219 
00220   T* tmp1 = ACE_reinterpret_cast (T *, this->buffer_);
00221   T* const tmp2 = ACE_reinterpret_cast (T * ACE_CAST_CONST, rhs.buffer_);
00222 
00223   for (CORBA::ULong i = 0; i < this->length_; ++i)
00224     {
00225       tmp1[i] = tmp2[i];
00226     }
00227 
00228   return *this;
00229 }
00230 
00231 template<class T, size_t MAX>
00232 TAO_Bounded_Sequence<T, MAX>::~TAO_Bounded_Sequence (void)
00233 {
00234   this->_deallocate_buffer ();
00235 }
00236 
00237 template<class T, size_t MAX> void
00238 TAO_Bounded_Sequence<T, MAX>::_allocate_buffer (CORBA::ULong)
00239 {
00240   // For this class memory is never reallocated so the implementation
00241   // is *really* simple.
00242   this->buffer_ = TAO_Bounded_Sequence<T, MAX>::allocbuf (MAX);
00243 }
00244 
00245 template<class T, size_t MAX> void
00246 TAO_Bounded_Sequence<T, MAX>::_deallocate_buffer (void)
00247 {
00248   if (this->release_ == 0)
00249     {
00250       return;
00251     }
00252 
00253   T *tmp = ACE_reinterpret_cast (T *,
00254                                  this->buffer_);
00255   TAO_Bounded_Sequence<T, MAX>::freebuf (tmp);
00256   this->buffer_ = 0;
00257 }
00258 
00259 // *************************************************************
00260 // class TAO_Object_Manager
00261 // *************************************************************
00262 
00263 template <class T, class T_var> TAO_Object_Manager<T,T_var>&
00264 
00265 TAO_Object_Manager<T,T_var>::    operator= (const TAO_Object_Manager<T,T_var> &rhs)
00266 {
00267   if (this == &rhs)
00268     {
00269       return *this;
00270     }
00271 
00272   if (this->release_)
00273     {
00274       T_var::tao_release (*this->ptr_);
00275       *this->ptr_ = T_var::tao_duplicate (*rhs.ptr_);
00276     }
00277   else
00278     *this->ptr_ = *rhs.ptr_;
00279 
00280   return *this;
00281 }
00282 
00283 template <class T, class T_var>TAO_Object_Manager<T,T_var> &
00284 TAO_Object_Manager<T,T_var>::operator=(T* p)
00285 {
00286   if (this->release_)
00287     {
00288       // The semantics of the elements of a sequence are the same as
00289       // that of a var variable.  Therefore we will not duplicate the
00290       // user provided pointer before assigning it to the internal
00291       // variable.
00292       T_var::tao_release (*this->ptr_);
00293       *this->ptr_ = p;
00294     }
00295   else
00296     *this->ptr_ = p;
00297 
00298   return *this;
00299 }
00300 
00301 template <class T, class T_var>TAO_Object_Manager<T,T_var> &
00302 TAO_Object_Manager<T,T_var>::operator=(const T_var &p)
00303 {
00304   if (this->release_)
00305     {
00306       // The semantics of the elements of a sequence are the same as
00307       // that of a var variable.  Therefore we duplicate p's
00308       // pointer before assigning it to the internal
00309       // variable.
00310       T_var::tao_release (*this->ptr_);
00311       *this->ptr_ = T_var::tao_duplicate (p.in ());
00312     }
00313   else
00314     {
00315       *this->ptr_ = p.in ();
00316     }
00317 
00318   return *this;
00319 }
00320 
00321 template <class T, class T_var> T *&
00322 TAO_Object_Manager<T,T_var>::out (void)
00323 {
00324   T_var::tao_release (*this->ptr_);
00325   *this->ptr_ = T_var::tao_nil ();
00326   return *this->ptr_;
00327 }
00328 
00329 template <class T, class T_var> T *
00330 TAO_Object_Manager<T,T_var>::_retn (void)
00331 {
00332   T *temp = *this->ptr_;
00333   *this->ptr_ = T_var::tao_nil ();
00334   return temp;
00335 }
00336 
00337 // *************************************************************
00338 // class TAO_Pseudo_Object_Manager
00339 // *************************************************************
00340 
00341 template <class T, class T_var> TAO_Pseudo_Object_Manager<T,T_var>&
00342 TAO_Pseudo_Object_Manager<T,T_var>::operator= (
00343     const TAO_Pseudo_Object_Manager<T,T_var> &rhs
00344   )
00345 {
00346   if (this == &rhs)
00347     {
00348       return *this;
00349     }
00350 
00351   if (this->release_)
00352     {
00353       CORBA::release (*this->ptr_);
00354       *this->ptr_ = T::_duplicate (*rhs.ptr_);
00355     }
00356   else
00357     {
00358       *this->ptr_ = *rhs.ptr_;
00359     }
00360 
00361   return *this;
00362 }
00363 
00364 template <class T, class T_var> TAO_Pseudo_Object_Manager<T,T_var> &
00365 TAO_Pseudo_Object_Manager<T,T_var>::operator=(T* p)
00366 {
00367   if (this->release_)
00368     {
00369       // The semantics of the elements of a sequence are the same as
00370       // that of a var variable.  Therefore we will not duplicate the
00371       // user provided pointer before assigning it to the internal
00372       // variable.  However, we will release it.
00373       CORBA::release (*this->ptr_);
00374       *this->ptr_ = p;
00375     }
00376   else
00377     {
00378       *this->ptr_ = p;
00379     }
00380 
00381   return *this;
00382 }
00383 
00384 template <class T, class T_var> TAO_Pseudo_Object_Manager<T,T_var> &
00385 TAO_Pseudo_Object_Manager<T,T_var>::operator=(const T_var &p)
00386 {
00387   if (this->release_)
00388     {
00389       // The semantics of the elements of a sequence are the same as
00390       // that of a var variable.  Therefore we duplicate p's
00391       // pointer before assigning it to the internal
00392       // variable.
00393       CORBA::release (*this->ptr_);
00394       *this->ptr_ = T::_duplicate (p.in ());
00395     }
00396   else
00397     {
00398       *this->ptr_ = p.in ();
00399     }
00400 
00401   return *this;
00402 }
00403 
00404 // *************************************************************
00405 // class TAO_Valuetype_Manager
00406 // *************************************************************
00407 
00408 template <class T, class T_var> 
00409 TAO_Valuetype_Manager<T,T_var> &
00410 TAO_Valuetype_Manager<T,T_var>::operator= (
00411     const TAO_Valuetype_Manager<T,T_var> &rhs
00412   )
00413 {
00414   if (this == &rhs)
00415     {
00416       return *this;
00417     }
00418 
00419   if (this->release_)
00420     {
00421       T_var::tao_remove_ref (*this->ptr_);
00422       *this->ptr_ = *rhs.ptr_;
00423       T_var::tao_add_ref (*this->ptr_);
00424     }
00425   else
00426     {
00427       *this->ptr_ = *rhs.ptr_;
00428     }
00429 
00430   return *this;
00431 }
00432 
00433 template <class T, class T_var>
00434 TAO_Valuetype_Manager<T,T_var> &
00435 TAO_Valuetype_Manager<T,T_var>::operator= (T *p)
00436 {
00437   if (this->release_)
00438     {
00439       // The semantics of the elements of a sequence are the same as
00440       // that of a var variable.  Therefore we will not duplicate the
00441       // user provided pointer before assigning it to the internal
00442       // variable.
00443       T_var::tao_remove_ref (*this->ptr_);
00444       *this->ptr_ = p;
00445     }
00446   else
00447     {
00448       *this->ptr_ = p;
00449     }
00450 
00451   return *this;
00452 }
00453 
00454 template <class T, class T_var>
00455 TAO_Valuetype_Manager<T,T_var> &
00456 TAO_Valuetype_Manager<T,T_var>::operator= (const T_var &p)
00457 {
00458   if (this->release_)
00459     {
00460       // The semantics of the elements of a sequence are the same as
00461       // that of a var variable.  Therefore we duplicate p's
00462       // pointer before assigning it to the internal
00463       // variable.
00464       if (*this->ptr_ != 0)
00465         {
00466           (*this->ptr_)->_remove_ref ();
00467         }
00468 
00469       T_var::tao_remove_ref (*this->ptr_);
00470       *this->ptr_ = p.in ();
00471       T_var::tao_add_ref (*this->ptr_);
00472     }
00473   else
00474     {
00475       *this->ptr_ = p.in ();
00476     }
00477 
00478   return *this;
00479 }
00480 
00481 // *************************************************************
00482 // class TAO_Abstract_Manager
00483 // *************************************************************
00484 
00485 template <class T, class T_var> 
00486 TAO_Abstract_Manager<T,T_var> &
00487 TAO_Abstract_Manager<T,T_var>::operator= (
00488     const TAO_Abstract_Manager<T,T_var> &rhs
00489   )
00490 {
00491   if (this == &rhs)
00492     {
00493       return *this;
00494     }
00495 
00496   if (this->release_)
00497     {
00498       if (*this->ptr_ != 0)
00499         {
00500           (*this->ptr_)->_remove_ref ();
00501         }
00502 
00503       *this->ptr_ = *rhs.ptr_;
00504 
00505       if (*this->ptr_ != 0)
00506         {
00507           (*this->ptr_)->_add_ref ();
00508         }
00509     }
00510   else
00511     {
00512       *this->ptr_ = *rhs.ptr_;
00513     }
00514 
00515   return *this;
00516 }
00517 
00518 template <class T, class T_var>
00519 TAO_Abstract_Manager<T,T_var> &
00520 TAO_Abstract_Manager<T,T_var>::operator= (T *p)
00521 {
00522   if (this->release_)
00523     {
00524       // The semantics of the elements of a sequence are the same as
00525       // that of a var variable.  Therefore we will not duplicate the
00526       // user provided pointer before assigning it to the internal
00527       // variable.
00528       if (*this->ptr_ != 0)
00529         {
00530           (*this->ptr_)->_remove_ref ();
00531         }
00532 
00533       *this->ptr_ = p;
00534     }
00535   else
00536     {
00537       *this->ptr_ = p;
00538     }
00539 
00540   return *this;
00541 }
00542 
00543 template <class T, class T_var>
00544 TAO_Abstract_Manager<T,T_var> &
00545 TAO_Abstract_Manager<T,T_var>::operator= (const T_var &p)
00546 {
00547   if (this->release_)
00548     {
00549       // The semantics of the elements of a sequence are the same as
00550       // that of a var variable.  Therefore we duplicate p's
00551       // pointer before assigning it to the internal
00552       // variable.
00553       if (*this->ptr_ != 0)
00554         {
00555           (*this->ptr_)->_remove_ref ();
00556         }
00557 
00558       *this->ptr_ = p.in ();
00559 
00560       if (p != 0)
00561         {
00562           p->_add_ref ();
00563         }
00564     }
00565   else
00566     {
00567       *this->ptr_ = p.in ();
00568     }
00569 
00570   return *this;
00571 }
00572 
00573 // *************************************************************
00574 // Operations for class TAO_Unbounded_Object_Sequence
00575 // *************************************************************
00576 
00577 // constructor for unbounded seq
00578 template <class T, class T_var>
00579 TAO_Unbounded_Object_Sequence<T,T_var>::TAO_Unbounded_Object_Sequence (
00580     CORBA::ULong maximum
00581   )
00582   : TAO_Unbounded_Base_Sequence (
00583         maximum,
00584          TAO_Unbounded_Object_Sequence<T,T_var>::allocbuf (maximum)
00585        )
00586 {
00587 }
00588 
00589 template <class T, class T_var>
00590 TAO_Unbounded_Object_Sequence<T,T_var>::TAO_Unbounded_Object_Sequence (
00591     const TAO_Unbounded_Object_Sequence<T,T_var> &rhs
00592   )
00593   : TAO_Unbounded_Base_Sequence (rhs)
00594 {
00595   if (rhs.buffer_ != 0)
00596     {
00597       T **tmp1 =
00598         TAO_Unbounded_Object_Sequence<T,T_var>::allocbuf (this->maximum_);
00599       T ** const tmp2 =
00600         ACE_reinterpret_cast (T ** ACE_CAST_CONST, rhs.buffer_);
00601 
00602       for (CORBA::ULong i = 0; i < rhs.length_; ++i)
00603         {
00604           tmp1[i] = T_var::tao_duplicate (tmp2[i]);
00605         }
00606 
00607       this->buffer_ = tmp1;
00608     }
00609   else
00610     {
00611       this->buffer_ = 0;
00612     }
00613 }
00614 
00615 template<class T, class T_var>
00616 TAO_Unbounded_Object_Sequence<T,T_var>::~TAO_Unbounded_Object_Sequence (void)
00617 {
00618   this->_deallocate_buffer ();
00619 }
00620 
00621 // Assignment operator.
00622 template <class T, class T_var>TAO_Unbounded_Object_Sequence<T,T_var>&
00623 
00624 TAO_Unbounded_Object_Sequence<T,T_var>::operator= (const TAO_Unbounded_Object_Sequence<T,T_var> &rhs)
00625 {
00626   if (this == &rhs)
00627     {
00628       return *this;
00629     }
00630 
00631   if (this->release_)
00632     {
00633       T **tmp = ACE_reinterpret_cast (T **,
00634                                       this->buffer_);
00635 
00636       for (CORBA::ULong i = 0; i < this->length_; ++i)
00637         {
00638           T_var::tao_release (tmp[i]);
00639           tmp[i] = T_var::tao_nil ();
00640         }
00641 
00642       if (this->maximum_ < rhs.maximum_)
00643         {
00644           TAO_Unbounded_Object_Sequence<T,T_var>::freebuf (tmp);
00645           this->buffer_ =
00646             TAO_Unbounded_Object_Sequence<T,T_var>::allocbuf (rhs.maximum_);
00647         }
00648     }
00649   else
00650     {
00651       if (rhs.maximum_ == 0)
00652         {
00653           this->buffer_ = 0;
00654         }
00655       else
00656         {
00657           this->buffer_ =
00658             TAO_Unbounded_Object_Sequence<T,T_var>::allocbuf (rhs.maximum_);
00659         }
00660     }
00661 
00662   TAO_Unbounded_Base_Sequence::operator= (rhs);
00663 
00664   T **tmp1 = ACE_reinterpret_cast (T **, this->buffer_);
00665   T ** const tmp2 = ACE_reinterpret_cast (T ** ACE_CAST_CONST, rhs.buffer_);
00666 
00667   for (CORBA::ULong i = 0; i < rhs.length_; ++i)
00668     {
00669       tmp1[i] = T_var::tao_duplicate (tmp2[i]);
00670     }
00671 
00672   return *this;
00673 }
00674 
00675 template <class T, class T_var> T **
00676 TAO_Unbounded_Object_Sequence<T,T_var>::allocbuf (CORBA::ULong nelems)
00677 {
00678   T **buf = 0;
00679   ACE_NEW_RETURN (buf, 
00680                   T*[nelems], 
00681                   0);
00682 
00683   for (CORBA::ULong i = 0; i < nelems; i++)
00684     {
00685       buf[i] = T_var::tao_nil ();
00686     }
00687 
00688   return buf;
00689 }
00690 
00691 template <class T, class T_var> void
00692 TAO_Unbounded_Object_Sequence<T,T_var>::freebuf (T **buffer)
00693 {
00694   if (buffer == 0)
00695     {
00696       return;
00697     }
00698 
00699   // {orbos/97-05-15:16.11} The freebuf function ensures that the
00700   // destructor for each element is called before the buffer is
00701   // destroyed, except for string elements, which are freed using
00702   // string_free(), and object reference elements, which are freed
00703   // using release(). The freebuf function will ignore null pointers
00704   // passed to it.
00705 
00706   // @@ How are we supposed to implement that! We don't know the
00707   // length of the buffer here.
00708   // Mark the length in the first four bytes? For the moment we let
00709   // that be.
00710 
00711   delete [] buffer;
00712 }
00713 
00714 template<class T, class T_var> void
00715 TAO_Unbounded_Object_Sequence<T,T_var>::_allocate_buffer (CORBA::ULong length)
00716 {
00717   T **tmp = TAO_Unbounded_Object_Sequence<T,T_var>::allocbuf (length);
00718 
00719   if (this->buffer_ != 0)
00720     {
00721       T **old = ACE_reinterpret_cast (T**, 
00722                                       this->buffer_);
00723 
00724       for (CORBA::ULong i = 0; i < this->length_; ++i)
00725         // Only call duplicate when we did not own the previous
00726         // buffer, since after this method we own it we must also own
00727         // the objects.  If we already own the objects there is no
00728         // need to copy them, if we did we would also have to remove
00729         // the old instances.
00730         if (!this->release_)
00731           {
00732             tmp[i] = T_var::tao_duplicate (old[i]);
00733           }
00734         else
00735           {
00736             tmp[i] = old[i];
00737           }
00738 
00739       if (this->release_)
00740         {
00741           delete [] old;
00742         }
00743     }
00744 
00745   this->buffer_ = tmp;
00746 }
00747 
00748 template<class T, class T_var> void
00749 TAO_Unbounded_Object_Sequence<T,T_var>::_deallocate_buffer (void)
00750 {
00751   if (this->buffer_ == 0 || this->release_ == 0)
00752     {
00753       return;
00754     }
00755 
00756   T **tmp = ACE_reinterpret_cast (T**, 
00757                                   this->buffer_);
00758 
00759   for (CORBA::ULong i = 0; i < this->length_; ++i)
00760     {
00761       T_var::tao_release (tmp[i]);
00762       tmp[i] = T_var::tao_nil ();
00763     }
00764 
00765   TAO_Unbounded_Object_Sequence<T,T_var>::freebuf (tmp);
00766   this->buffer_ = 0;
00767 }
00768 
00769 template<class T, class T_var> void
00770 TAO_Unbounded_Object_Sequence<T,T_var>::_shrink_buffer (CORBA::ULong nl,
00771                                                         CORBA::ULong ol)
00772 {
00773   T **tmp = ACE_static_cast (T**, this->buffer_);
00774 
00775   for (CORBA::ULong i = nl; i < ol; ++i)
00776     {
00777       T_var::tao_release (tmp[i]);
00778       tmp[i] = T_var::tao_nil ();
00779     }
00780 }
00781 
00782 template <class T, class T_var> void
00783 TAO_Unbounded_Object_Sequence<T,T_var>::_downcast (void* target,
00784                                                    CORBA_Object* src
00785                                                    ACE_ENV_ARG_DECL)
00786 {
00787   T **tmp = ACE_static_cast (T**, 
00788                              target);
00789 
00790   *tmp = T_var::tao_narrow (src 
00791                             ACE_ENV_ARG_PARAMETER);
00792 
00793   ACE_CHECK;
00794 }
00795 
00796 template <class T, class T_var> CORBA_Object*
00797 TAO_Unbounded_Object_Sequence<T,T_var>::_upcast (void* src) const
00798 {
00799   return T_var::tao_upcast (src);
00800 }
00801 
00802 // *************************************************************
00803 // Operations for class TAO_Bounded_Object_Sequence
00804 // *************************************************************
00805 
00806 template <class T, class T_var, size_t MAX>
00807 TAO_Bounded_Object_Sequence<T, T_var,MAX>::TAO_Bounded_Object_Sequence (void)
00808   : TAO_Bounded_Base_Sequence (
00809         MAX,
00810         TAO_Bounded_Object_Sequence<T, T_var,MAX>::allocbuf (MAX)
00811       )
00812 {
00813 }
00814 
00815 template <class T, class T_var, size_t MAX>
00816 TAO_Bounded_Object_Sequence<T, T_var,MAX>::TAO_Bounded_Object_Sequence (
00817     const TAO_Bounded_Object_Sequence<T, T_var,MAX> &rhs
00818   )
00819   : TAO_Bounded_Base_Sequence (rhs)
00820 {
00821   if (rhs.buffer_ != 0)
00822     {
00823       T **tmp1 =
00824         TAO_Bounded_Object_Sequence<T, T_var,MAX>::allocbuf (MAX);
00825 
00826       T ** const tmp2 =
00827         ACE_reinterpret_cast (T** ACE_CAST_CONST, 
00828                               rhs.buffer_);
00829 
00830       for (CORBA::ULong i = 0; i < rhs.length_; i++)
00831         {
00832           tmp1[i] = T_var::tao_duplicate (tmp2[i]);
00833         }
00834 
00835       this->buffer_ = tmp1;
00836     }
00837   else
00838     {
00839       this->buffer_ = 0;
00840     }
00841 }
00842 
00843 template <class T, class T_var, size_t MAX> TAO_Bounded_Object_Sequence<T, T_var,MAX>&
00844 TAO_Bounded_Object_Sequence<T, T_var,MAX>::operator= (
00845     const TAO_Bounded_Object_Sequence<T,T_var, MAX> &rhs
00846   )
00847 {
00848   if (this == &rhs)
00849     {
00850       return *this;
00851     }
00852 
00853   if (this->release_)
00854     {
00855       T **tmp = ACE_reinterpret_cast (T **, 
00856                                       this->buffer_);
00857 
00858       for (CORBA::ULong i = 0; i < this->length_; ++i)
00859         {
00860           T_var::tao_release (tmp[i]);
00861           tmp[i] = T_var::tao_nil ();
00862         }
00863       // No need to reallocate the buffer since it is always of size
00864       // MAX
00865     }
00866   else
00867     {
00868       if (rhs.maximum_ == 0)
00869         {
00870           this->buffer_ = 0;
00871         }
00872       else
00873         {
00874           this->buffer_ =
00875             TAO_Bounded_Object_Sequence<T,T_var,MAX>::allocbuf (rhs.maximum_);
00876         }
00877     }
00878 
00879   TAO_Bounded_Base_Sequence::operator= (rhs);
00880 
00881   T **tmp1 = ACE_reinterpret_cast (T **, 
00882                                    this->buffer_);
00883   T ** const tmp2 = ACE_reinterpret_cast (T ** ACE_CAST_CONST, 
00884                                           rhs.buffer_);
00885 
00886   for (CORBA::ULong i=0; i < rhs.length_; ++i)
00887     {
00888       tmp1[i] = T_var::tao_duplicate (tmp2[i]);
00889     }
00890 
00891   return *this;
00892 }
00893 
00894 template <class T, class T_var, size_t MAX> T **
00895 TAO_Bounded_Object_Sequence<T, T_var,MAX>::allocbuf (CORBA::ULong)
00896 {
00897   T **buf = 0;
00898   ACE_NEW_RETURN (buf, 
00899                   T*[MAX], 
00900                   0);
00901 
00902   for (CORBA::ULong i = 0; i < MAX; i++)
00903     {
00904       buf[i] = T_var::tao_nil ();
00905     }
00906 
00907   return buf;
00908 }
00909 
00910 template <class T, class T_var, size_t MAX> void
00911 TAO_Bounded_Object_Sequence<T, T_var,MAX>::freebuf (T **buffer)
00912 {
00913   // How much do we deallocate? Easy! allocbuf() always creates MAX
00914   // elements and initialize them to T::_nil().  So we can be
00915   // complaint and call CORBA::release() on each one.
00916   for (CORBA::ULong i = 0; i < MAX; ++i)
00917     {
00918       if (buffer[i] != T_var::tao_nil ())
00919         {
00920           T_var::tao_release (buffer[i]);
00921           buffer[i] = T_var::tao_nil ();
00922         }
00923     }
00924 
00925   delete [] buffer;
00926 }
00927 
00928 template<class T, class T_var, size_t MAX> void
00929 TAO_Bounded_Object_Sequence<T, T_var,MAX>::_allocate_buffer (CORBA::ULong length)
00930 {
00931   // For this class memory is never reallocated so the implementation
00932   // is *really* simple.
00933   this->buffer_ =
00934     TAO_Bounded_Object_Sequence<T, T_var,MAX>::allocbuf (length);
00935 }
00936 
00937 template<class T, class T_var, size_t MAX> void
00938 TAO_Bounded_Object_Sequence<T,T_var,MAX>::_deallocate_buffer (void)
00939 {
00940   if (this->release_ == 0)
00941     {
00942       return;
00943     }
00944 
00945   T **tmp = ACE_reinterpret_cast (T **, 
00946                                   this->buffer_);
00947   TAO_Bounded_Object_Sequence<T,T_var,MAX>::freebuf (tmp);
00948   this->buffer_ = 0;
00949 }
00950 
00951 template<class T, class T_var, size_t MAX> void
00952 TAO_Bounded_Object_Sequence<T,T_var, MAX>::_shrink_buffer (CORBA::ULong nl,
00953                                                            CORBA::ULong ol)
00954 {
00955   T **tmp = ACE_reinterpret_cast (T **, this->buffer_);
00956 
00957   for (CORBA::ULong i = nl; i < ol; ++i)
00958     {
00959       T_var::tao_release (tmp[i]);
00960       tmp[i] = T_var::tao_nil ();
00961     }
00962 }
00963 
00964 template <class T, class T_var, size_t MAX> void
00965 TAO_Bounded_Object_Sequence<T, T_var,MAX>::_downcast (void* target,
00966                                                       CORBA_Object* src
00967                                                       ACE_ENV_ARG_DECL)
00968 {
00969   T **tmp = ACE_static_cast (T**, 
00970                              target);
00971 
00972   *tmp = T_var::tao_narrow (src 
00973                             ACE_ENV_ARG_PARAMETER);
00974 
00975   ACE_CHECK;
00976 }
00977 
00978 template <class T, class T_var, size_t MAX> CORBA_Object*
00979 TAO_Bounded_Object_Sequence<T, T_var,MAX>::_upcast (void* src) const
00980 {
00981   return T_var::tao_upcast (src);
00982 }
00983 
00984 // *************************************************************
00985 // Operations for class TAO_Unbounded_Pseudo_Sequence
00986 // *************************************************************
00987 
00988 // Constructor for unbounded sequence.
00989 template <class T, class T_var>
00990 
00991 TAO_Unbounded_Pseudo_Sequence<T,T_var>::TAO_Unbounded_Pseudo_Sequence (CORBA::ULong maximum)
00992   : TAO_Unbounded_Base_Sequence (
00993         maximum,
00994         TAO_Unbounded_Pseudo_Sequence<T,T_var>::allocbuf (maximum)
00995       )
00996 {
00997 }
00998 
00999 template <class T, class T_var>
01000 TAO_Unbounded_Pseudo_Sequence<T,T_var>::TAO_Unbounded_Pseudo_Sequence (
01001     const TAO_Unbounded_Pseudo_Sequence<T,T_var> &rhs
01002   )
01003   : TAO_Unbounded_Base_Sequence (rhs)
01004 {
01005   if (rhs.buffer_ != 0)
01006     {
01007       T **tmp1 =
01008         TAO_Unbounded_Pseudo_Sequence<T,T_var>::allocbuf (this->maximum_);
01009 
01010       T ** const tmp2 =
01011         ACE_reinterpret_cast (T ** ACE_CAST_CONST, 
01012                               rhs.buffer_);
01013 
01014       for (CORBA::ULong i = 0; i < rhs.length_; ++i)
01015         {
01016           tmp1[i] = T::_duplicate (tmp2[i]);
01017         }
01018 
01019       this->buffer_ = tmp1;
01020     }
01021   else
01022     {
01023       this->buffer_ = 0;
01024     }
01025 }
01026 
01027 template<class T, class T_var>
01028 TAO_Unbounded_Pseudo_Sequence<T,T_var>::~TAO_Unbounded_Pseudo_Sequence (void)
01029 {
01030   this->_deallocate_buffer ();
01031 }
01032 
01033 // assignment operator
01034 template <class T, class T_var> TAO_Unbounded_Pseudo_Sequence<T,T_var>&
01035 
01036 TAO_Unbounded_Pseudo_Sequence<T,T_var>::operator= (const TAO_Unbounded_Pseudo_Sequence<T,T_var> &rhs)
01037 {
01038   if (this == &rhs)
01039     {
01040       return *this;
01041     }
01042 
01043   if (this->release_)
01044     {
01045       T **tmp = ACE_reinterpret_cast (T **,
01046                                       this->buffer_);
01047 
01048       for (CORBA::ULong i = 0; i < this->length_; ++i)
01049         {
01050           CORBA::release (tmp[i]);
01051           tmp[i] = T::_nil ();
01052         }
01053 
01054       if (this->maximum_ < rhs.maximum_)
01055         {
01056           TAO_Unbounded_Pseudo_Sequence<T,T_var>::freebuf (tmp);
01057           this->buffer_ =
01058             TAO_Unbounded_Pseudo_Sequence<T,T_var>::allocbuf (rhs.maximum_);
01059         }
01060     }
01061   else
01062     {
01063       if (rhs.maximum_ == 0)
01064         {
01065           this->buffer_ = 0;
01066         }
01067       else
01068         {
01069           this->buffer_ =
01070             TAO_Unbounded_Pseudo_Sequence<T,T_var>::allocbuf (rhs.maximum_);
01071         }
01072     }
01073 
01074   TAO_Unbounded_Base_Sequence::operator= (rhs);
01075 
01076   T **tmp1 = ACE_reinterpret_cast (T **, 
01077                                    this->buffer_);
01078   T ** const tmp2 = ACE_reinterpret_cast (T ** ACE_CAST_CONST, 
01079                                           rhs.buffer_);
01080 
01081   for (CORBA::ULong i = 0; i < rhs.length_; ++i)
01082     {
01083       tmp1[i] = T::_duplicate (tmp2[i]);
01084     }
01085 
01086   return *this;
01087 }
01088 
01089 template <class T, class T_var> T **
01090 TAO_Unbounded_Pseudo_Sequence<T,T_var>::allocbuf (CORBA::ULong nelems)
01091 {
01092   T **buf = 0;
01093   ACE_NEW_RETURN (buf, 
01094                   T*[nelems], 
01095                   0);
01096 
01097   for (CORBA::ULong i = 0; i < nelems; i++)
01098     {
01099       buf[i] = T::_nil ();
01100     }
01101 
01102   return buf;
01103 }
01104 
01105 template <class T, class T_var> void
01106 TAO_Unbounded_Pseudo_Sequence<T,T_var>::freebuf (T **buffer)
01107 {
01108   if (buffer == 0)
01109     {
01110       return;
01111     }
01112 
01113   // {orbos/97-05-15:16.11} The freebuf function ensures that the
01114   // destructor for each element is called before the buffer is
01115   // destroyed, except for string elements, which are freed using
01116   // string_free(), and object reference elements, which are freed
01117   // using release(). The freebuf function will ignore null pointers
01118   // passed to it.
01119 
01120   // @@ How are we supposed to implement that! We don't know the
01121   // length of the buffer here.
01122   // Mark the length in the first four bytes? For the moment we let
01123   // that be.
01124 
01125   delete [] buffer;
01126 }
01127 
01128 template<class T, class T_var> void
01129 TAO_Unbounded_Pseudo_Sequence<T,T_var>::_allocate_buffer (CORBA::ULong length)
01130 {
01131   T **tmp = TAO_Unbounded_Pseudo_Sequence<T,T_var>::allocbuf (length);
01132 
01133   if (this->buffer_ != 0)
01134     {
01135       T **old = ACE_reinterpret_cast (T**, 
01136                                       this->buffer_);
01137 
01138       for (CORBA::ULong i = 0; i < this->length_; ++i)
01139         // Only call duplicate when we did not own the previous
01140         // buffer, since after this method we own it we must also own
01141         // the objects.  If we already own the objects there is no
01142         // need to copy them, if we did we would also have to remove
01143         // the old instances.
01144         if (!this->release_)
01145           {
01146             tmp[i] = T::_duplicate (old[i]);
01147           }
01148         else
01149           {
01150             tmp[i] = old[i];
01151           }
01152 
01153       if (this->release_)
01154         {
01155           delete [] old;
01156         }
01157     }
01158   this->buffer_ = tmp;
01159 }
01160 
01161 template<class T, class T_var> void
01162 TAO_Unbounded_Pseudo_Sequence<T,T_var>::_deallocate_buffer (void)
01163 {
01164   if (this->buffer_ == 0 || this->release_ == 0)
01165     {
01166       return;
01167     }
01168 
01169   T **tmp = ACE_reinterpret_cast (T**, 
01170                                   this->buffer_);
01171 
01172   for (CORBA::ULong i = 0; i < this->length_; ++i)
01173     {
01174       CORBA::release (tmp[i]);
01175       tmp[i] = T::_nil ();
01176     }
01177 
01178   TAO_Unbounded_Pseudo_Sequence<T,T_var>::freebuf (tmp);
01179   this->buffer_ = 0;
01180 }
01181 
01182 template<class T, class T_var> void
01183 TAO_Unbounded_Pseudo_Sequence<T,T_var>::_shrink_buffer (CORBA::ULong nl,
01184                                                         CORBA::ULong ol)
01185 {
01186   T **tmp = ACE_static_cast (T**, this->buffer_);
01187 
01188   for (CORBA::ULong i = nl; i < ol; ++i)
01189     {
01190       CORBA::release (tmp[i]);
01191       tmp[i] = T::_nil ();
01192     }
01193 }
01194 
01195 // *************************************************************
01196 // Operations for class TAO_Bounded_Pseudo_Sequence
01197 // *************************************************************
01198 
01199 template <class T, class T_var, size_t MAX>
01200 
01201 TAO_Bounded_Pseudo_Sequence<T, T_var,MAX>::TAO_Bounded_Pseudo_Sequence (void)
01202   : TAO_Bounded_Base_Sequence (
01203         MAX,
01204         TAO_Bounded_Pseudo_Sequence<T, T_var,MAX>::allocbuf (MAX)
01205       )
01206 {
01207 }
01208 
01209 template <class T, class T_var, size_t MAX>
01210 TAO_Bounded_Pseudo_Sequence<T, T_var,MAX>::TAO_Bounded_Pseudo_Sequence (
01211     const TAO_Bounded_Pseudo_Sequence<T, T_var,MAX> &rhs
01212   )
01213   : TAO_Bounded_Base_Sequence (rhs)
01214 {
01215   if (rhs.buffer_ != 0)
01216     {
01217       T **tmp1 =
01218         TAO_Bounded_Pseudo_Sequence<T, T_var,MAX>::allocbuf (MAX);
01219 
01220       T ** const tmp2 =
01221        ACE_reinterpret_cast (T** ACE_CAST_CONST, rhs.buffer_);
01222 
01223       for (CORBA::ULong i = 0; i < rhs.length_; i++)
01224         {
01225           tmp1[i] = T::_duplicate (tmp2[i]);
01226         }
01227 
01228       this->buffer_ = tmp1;
01229     }
01230   else
01231     {
01232       this->buffer_ = 0;
01233     }
01234 }
01235 
01236 template <class T, class T_var, size_t MAX> TAO_Bounded_Pseudo_Sequence<T, T_var,MAX>&
01237 TAO_Bounded_Pseudo_Sequence<T, T_var,MAX>::operator= (
01238     const TAO_Bounded_Pseudo_Sequence<T, T_var,MAX> &rhs
01239   )
01240 {
01241   if (this == &rhs)
01242     {
01243       return *this;
01244     }
01245 
01246   if (this->release_)
01247     {
01248       T **tmp = ACE_reinterpret_cast (T **, 
01249                                       this->buffer_);
01250 
01251       for (CORBA::ULong i = 0; i < this->length_; ++i)
01252         {
01253           CORBA::release (tmp[i]);
01254           tmp[i] = T::_nil ();
01255         }
01256       // No need to reallocate the buffer since it is always of size
01257       // MAX
01258     }
01259   else
01260     {
01261       if (rhs.maximum_ == 0)
01262         {
01263           this->buffer_ = 0;
01264         }
01265       else
01266         {
01267           this->buffer_ =
01268             TAO_Bounded_Pseudo_Sequence<T,T_var,MAX>::allocbuf (rhs.maximum_);
01269         }
01270     }
01271 
01272   TAO_Bounded_Base_Sequence::operator= (rhs);
01273 
01274   T **tmp1 = ACE_reinterpret_cast (T **, 
01275                                    this->buffer_);
01276   T ** const tmp2 = ACE_reinterpret_cast (T ** ACE_CAST_CONST, 
01277                                           rhs.buffer_);
01278 
01279   for (CORBA::ULong i=0; i < rhs.length_; ++i)
01280     {
01281       tmp1[i] = T::_duplicate (tmp2[i]);
01282     }
01283 
01284   return *this;
01285 }
01286 
01287 template <class T, class T_var, size_t MAX> T **
01288 TAO_Bounded_Pseudo_Sequence<T, T_var,MAX>::allocbuf (CORBA::ULong)
01289 {
01290   T **buf = 0;
01291   ACE_NEW_RETURN (buf, 
01292                   T*[MAX], 
01293                   0);
01294 
01295   for (CORBA::ULong i = 0; i < MAX; ++i)
01296     {
01297       buf[i] = T::_nil ();
01298     }
01299 
01300   return buf;
01301 }
01302 
01303 template <class T, class T_var, size_t MAX> void
01304 TAO_Bounded_Pseudo_Sequence<T, T_var,MAX>::freebuf (T **buffer)
01305 {
01306   // How much do we deallocate? Easy! allocbuf() always creates MAX
01307   // elements and initialize them to T::_nil().  So we can be
01308   // complaint and call CORBA::release() on each one.
01309   for (CORBA::ULong i = 0; i < MAX; ++i)
01310     {
01311       if (buffer[i] != T::_nil ())
01312         {
01313           CORBA::release (buffer[i]);
01314           buffer[i] = T::_nil ();
01315         }
01316     }
01317 
01318   delete [] buffer;
01319 }
01320 
01321 template<class T, class T_var, size_t MAX> void
01322 TAO_Bounded_Pseudo_Sequence<T, T_var,MAX>::_allocate_buffer (CORBA::ULong length)
01323 {
01324   // For this class memory is never reallocated so the implementation
01325   // is *really* simple.
01326   this->buffer_ =
01327     TAO_Bounded_Pseudo_Sequence<T, T_var,MAX>::allocbuf (length);
01328 }
01329 
01330 template<class T, class T_var, size_t MAX> void
01331 TAO_Bounded_Pseudo_Sequence<T, T_var,MAX>::_deallocate_buffer (void)
01332 {
01333   if (this->release_ == 0)
01334     {
01335       return;
01336     }
01337 
01338   T **tmp = ACE_reinterpret_cast (T **, 
01339                                   this->buffer_);
01340   TAO_Bounded_Pseudo_Sequence<T, T_var, MAX>::freebuf (tmp);
01341   this->buffer_ = 0;
01342 }
01343 
01344 template<class T, class T_var, size_t MAX> void
01345 TAO_Bounded_Pseudo_Sequence<T, T_var,MAX>::_shrink_buffer (CORBA::ULong nl,
01346                                                            CORBA::ULong ol)
01347 {
01348   T **tmp = ACE_reinterpret_cast (T **, 
01349                                   this->buffer_);
01350 
01351   for (CORBA::ULong i = nl; i < ol; ++i)
01352     {
01353       CORBA::release (tmp[i]);
01354       tmp[i] = T::_nil ();
01355     }
01356 }
01357 
01358 // *************************************************************
01359 // Operations for class TAO_Unbounded_Valuetype_Sequence
01360 // *************************************************************
01361 
01362 // Constructor for unbounded sequence.
01363 template <class T, class T_var>
01364 TAO_Unbounded_Valuetype_Sequence<T, T_var>::TAO_Unbounded_Valuetype_Sequence (
01365     CORBA::ULong maximum
01366   )
01367   : TAO_Unbounded_Base_Sequence (
01368         maximum,
01369         TAO_Unbounded_Valuetype_Sequence<T, T_var>::allocbuf (maximum)
01370       )
01371 {
01372 }
01373 
01374 template <class T, class T_var>
01375 TAO_Unbounded_Valuetype_Sequence<T, T_var>::TAO_Unbounded_Valuetype_Sequence (
01376     const TAO_Unbounded_Valuetype_Sequence<T, T_var> &rhs
01377   )
01378   : TAO_Unbounded_Base_Sequence (rhs)
01379 {
01380   if (rhs.buffer_ != 0)
01381     {
01382       T **tmp1 =
01383         TAO_Unbounded_Valuetype_Sequence<T, T_var>::allocbuf (this->maximum_);
01384       T ** const tmp2 =
01385         ACE_reinterpret_cast (T ** ACE_CAST_CONST, 
01386                               rhs.buffer_);
01387 
01388       for (CORBA::ULong i = 0; i < rhs.length_; ++i)
01389         {
01390           T_var::tao_add_ref (tmp2[i]);
01391           tmp1[i] = tmp2[i];
01392         }
01393 
01394       this->buffer_ = tmp1;
01395     }
01396   else
01397     {
01398       this->buffer_ = 0;
01399     }
01400 }
01401 
01402 template<class T, class T_var>
01403 TAO_Unbounded_Valuetype_Sequence<T, T_var>::~TAO_Unbounded_Valuetype_Sequence (
01404     void
01405   )
01406 {
01407   this->_deallocate_buffer ();
01408 }
01409 
01410 // assignment operator
01411 template <class T, class T_var>
01412 TAO_Unbounded_Valuetype_Sequence<T, T_var>&
01413 TAO_Unbounded_Valuetype_Sequence<T, T_var>::operator= (
01414     const TAO_Unbounded_Valuetype_Sequence<T, T_var> &rhs
01415   )
01416 {
01417   if (this == &rhs)
01418     {
01419       return *this;
01420     }
01421 
01422   if (this->release_)
01423     {
01424       T **tmp = ACE_reinterpret_cast (T **,
01425                                       this->buffer_);
01426 
01427       for (CORBA::ULong i = 0; i < this->length_; ++i)
01428         {
01429           T_var::tao_remove_ref (tmp[i]);
01430           tmp[i] = 0;
01431         }
01432 
01433       if (this->maximum_ < rhs.maximum_)
01434         {
01435           TAO_Unbounded_Valuetype_Sequence<T, T_var>::freebuf (tmp);
01436           this->buffer_ =
01437             TAO_Unbounded_Valuetype_Sequence<T, T_var>::allocbuf (rhs.maximum_);
01438         }
01439     }
01440   else
01441     {
01442       if (rhs.maximum_ == 0)
01443         {
01444           this->buffer_ = 0;
01445         }
01446       else
01447         {
01448           this->buffer_ =
01449             TAO_Unbounded_Valuetype_Sequence<T, T_var>::allocbuf (
01450                 rhs.maximum_
01451               );
01452         }
01453     }
01454 
01455   TAO_Unbounded_Base_Sequence::operator= (rhs);
01456 
01457   T **tmp1 = ACE_reinterpret_cast (T **, 
01458                                    this->buffer_);
01459   T ** const tmp2 = ACE_reinterpret_cast (T ** ACE_CAST_CONST, 
01460                                           rhs.buffer_);
01461 
01462   for (CORBA::ULong i = 0; i < rhs.length_; ++i)
01463     {
01464       T_var::tao_add_ref (tmp2[i]);
01465       tmp1[i] = tmp2[i];
01466     }
01467 
01468   return *this;
01469 }
01470 
01471 template <class T, class T_var> 
01472 T **
01473 TAO_Unbounded_Valuetype_Sequence<T, T_var>::allocbuf (CORBA::ULong nelems)
01474 {
01475   T **buf = 0;
01476   ACE_NEW_RETURN (buf, 
01477                   T*[nelems], 
01478                   0);
01479 
01480   for (CORBA::ULong i = 0; i < nelems; i++)
01481     {
01482       buf[i] = 0;
01483     }
01484 
01485   return buf;
01486 }
01487 
01488 template <class T, class T_var> 
01489 void
01490 TAO_Unbounded_Valuetype_Sequence<T, T_var>::freebuf (T **buffer)
01491 {
01492   if (buffer == 0)
01493     {
01494       return;
01495     }
01496 
01497   // {orbos/97-05-15:16.11} The freebuf function ensures that the
01498   // destructor for each element is called before the buffer is
01499   // destroyed, except for string elements, which are freed using
01500   // string_free(), and object reference elements, which are freed
01501   // using release(). The freebuf function will ignore null pointers
01502   // passed to it.
01503 
01504   // @@ How are we supposed to implement that! We don't know the
01505   // length of the buffer here.
01506   // Mark the length in the first four bytes? For the moment we let
01507   // that be.
01508 
01509   delete [] buffer;
01510 }
01511 
01512 template<class T, class T_var> 
01513 void
01514 TAO_Unbounded_Valuetype_Sequence<T, T_var>::_allocate_buffer (
01515     CORBA::ULong length
01516   )
01517 {
01518   T **tmp = TAO_Unbounded_Valuetype_Sequence<T, T_var>::allocbuf (length);
01519 
01520   if (this->buffer_ != 0)
01521     {
01522       T **old = ACE_reinterpret_cast (T**, 
01523                                       this->buffer_);
01524 
01525       for (CORBA::ULong i = 0; i < this->length_; ++i)
01526         // Only call duplicate when we did not own the previous
01527         // buffer, since after this method we own it we must also own
01528         // the objects.  If we already own the objects there is no
01529         // need to copy them, if we did we would also have to remove
01530         // the old instances.
01531         if (!this->release_)
01532           {
01533             T_var::tao_add_ref (tmp[i]);
01534             tmp[i] = old[i];
01535           }
01536         else
01537           {
01538             tmp[i] = old[i];
01539           }
01540 
01541       if (this->release_)
01542         {
01543           delete [] old;
01544         }
01545     }
01546 
01547   this->buffer_ = tmp;
01548 }
01549 
01550 template<class T, class T_var> void
01551 TAO_Unbounded_Valuetype_Sequence<T, T_var>::_deallocate_buffer (void)
01552 {
01553   if (this->buffer_ == 0 || this->release_ == 0)
01554     {
01555       return;
01556     }
01557 
01558   T **tmp = ACE_reinterpret_cast (T**, 
01559                                   this->buffer_);
01560 
01561   for (CORBA::ULong i = 0; i < this->length_; ++i)
01562     {
01563       T_var::tao_remove_ref (tmp[i]);
01564       tmp[i] = 0;
01565     }
01566 
01567   TAO_Unbounded_Valuetype_Sequence<T, T_var>::freebuf (tmp);
01568   this->buffer_ = 0;
01569 }
01570 
01571 template<class T, class T_var> void
01572 TAO_Unbounded_Valuetype_Sequence<T ,T_var>::_shrink_buffer (CORBA::ULong nl,
01573                                                             CORBA::ULong ol)
01574 {
01575   T **tmp = ACE_static_cast (T**, 
01576                              this->buffer_);
01577 
01578   for (CORBA::ULong i = nl; i < ol; ++i)
01579     {
01580       T_var::tao_remove_ref (tmp[i]);
01581       tmp[i] = 0;
01582     }
01583 }
01584 
01585 // *************************************************************
01586 // Operations for class TAO_Bounded_Valuetype_Sequence
01587 // *************************************************************
01588 
01589 template <class T, class T_var, size_t MAX>
01590 TAO_Bounded_Valuetype_Sequence<T, T_var, MAX>::TAO_Bounded_Valuetype_Sequence (
01591     void
01592   )
01593   : TAO_Bounded_Base_Sequence (
01594         MAX,
01595         TAO_Bounded_Valuetype_Sequence<T, T_var, MAX>::allocbuf (MAX)
01596       )
01597 {
01598 }
01599 
01600 template <class T, class T_var, size_t MAX>
01601 TAO_Bounded_Valuetype_Sequence<T, T_var, MAX>::TAO_Bounded_Valuetype_Sequence (
01602     const TAO_Bounded_Valuetype_Sequence<T, T_var, MAX> &rhs
01603   )
01604   : TAO_Bounded_Base_Sequence (rhs)
01605 {
01606   if (rhs.buffer_ != 0)
01607     {
01608       T **tmp1 =
01609         TAO_Bounded_Valuetype_Sequence<T, T_var, MAX>::allocbuf (MAX);
01610 
01611       T ** const tmp2 =
01612         ACE_reinterpret_cast (T** ACE_CAST_CONST, rhs.buffer_);
01613 
01614       for (CORBA::ULong i = 0; i < rhs.length_; i++)
01615         {
01616           T_var::tao_add_ref (tmp2[i]);
01617           tmp1[i] = tmp2[i];
01618         }
01619 
01620       this->buffer_ = tmp1;
01621     }
01622   else
01623     {
01624       this->buffer_ = 0;
01625     }
01626 }
01627 
01628 template <class T, class T_var, size_t MAX> 
01629 TAO_Bounded_Valuetype_Sequence<T, T_var, MAX>&
01630 TAO_Bounded_Valuetype_Sequence<T, T_var, MAX>::operator= (
01631     const TAO_Bounded_Valuetype_Sequence<T, T_var, MAX> &rhs
01632   )
01633 {
01634   if (this == &rhs)
01635     {
01636       return *this;
01637     }
01638 
01639   if (this->release_)
01640     {
01641       T **tmp = ACE_reinterpret_cast (T **, 
01642                                       this->buffer_);
01643 
01644       for (CORBA::ULong i = 0; i < this->length_; ++i)
01645         {
01646           T_var::tao_remove_ref (tmp[i]);
01647           tmp[i] = 0;
01648         }
01649       // No need to reallocate the buffer since it is always of size
01650       // MAX
01651     }
01652   else
01653     {
01654       if (rhs.maximum_ == 0)
01655         {
01656           this->buffer_ = 0;
01657         }
01658       else
01659         {
01660           this->buffer_ =
01661             TAO_Bounded_Valuetype_Sequence<T, T_var, MAX>::allocbuf (
01662                 rhs.maximum_
01663               );
01664         }
01665     }
01666 
01667   TAO_Bounded_Base_Sequence::operator= (rhs);
01668 
01669   T **tmp1 = ACE_reinterpret_cast (T **, 
01670                                    this->buffer_);
01671   T ** const tmp2 = ACE_reinterpret_cast (T ** ACE_CAST_CONST, 
01672                                           rhs.buffer_);
01673 
01674   for (CORBA::ULong i=0; i < rhs.length_; ++i)
01675     {
01676       T_var::tao_add_ref (tmp2[i]);
01677       tmp1[i] = tmp2[i];
01678     }
01679 
01680   return *this;
01681 }
01682 
01683 template <class T, class T_var, size_t MAX> 
01684 T **
01685 TAO_Bounded_Valuetype_Sequence<T, T_var, MAX>::allocbuf (CORBA::ULong)
01686 {
01687   T **buf = 0;
01688   ACE_NEW_RETURN (buf, 
01689                   T*[MAX], 
01690                   0);
01691 
01692   for (CORBA::ULong i = 0; i < MAX; ++i)
01693     {
01694       buf[i] = 0;
01695     }
01696 
01697   return buf;
01698 }
01699 
01700 template <class T, class T_var, size_t MAX> 
01701 void
01702 TAO_Bounded_Valuetype_Sequence<T, T_var, MAX>::freebuf (T **buffer)
01703 {
01704   // How much do we deallocate? Easy! allocbuf() always creates MAX
01705   // elements and initialize them to T::_nil().  So we can be
01706   // complaint and call CORBA::release() on each one.
01707   for (CORBA::ULong i = 0; i < MAX; ++i)
01708     {
01709       if (buffer[i] != 0)
01710         {
01711           T_var::tao_remove_ref (buffer[i]);
01712           buffer[i] = 0;
01713         }
01714     }
01715 
01716   delete [] buffer;
01717 }
01718 
01719 template<class T, class T_var, size_t MAX> 
01720 void
01721 TAO_Bounded_Valuetype_Sequence<T, T_var, MAX>::_allocate_buffer (
01722     CORBA::ULong length
01723   )
01724 {
01725   // For this class memory is never reallocated so the implementation
01726   // is *really* simple.
01727   this->buffer_ =
01728     TAO_Bounded_Valuetype_Sequence<T, T_var, MAX>::allocbuf (length);
01729 }
01730 
01731 template<class T, class T_var, size_t MAX> 
01732 void
01733 TAO_Bounded_Valuetype_Sequence<T, T_var, MAX>::_deallocate_buffer (void)
01734 {
01735   if (this->release_ == 0)
01736     {
01737       return;
01738     }
01739 
01740   T **tmp = ACE_reinterpret_cast (T **, 
01741                                   this->buffer_);
01742   TAO_Bounded_Valuetype_Sequence<T, T_var, MAX>::freebuf (tmp);
01743   this->buffer_ = 0;
01744 }
01745 
01746 template<class T, class T_var, size_t MAX> 
01747 void
01748 TAO_Bounded_Valuetype_Sequence<T,T_var, MAX>::_shrink_buffer (CORBA::ULong nl,
01749                                                               CORBA::ULong ol)
01750 {
01751   T **tmp = ACE_reinterpret_cast (T **, 
01752                                   this->buffer_);
01753 
01754   for (CORBA::ULong i = nl; i < ol; ++i)
01755     {
01756       T_var::tao_remove_ref (tmp[i]);
01757       tmp[i] = 0;
01758     }
01759 }
01760 
01761 // *************************************************************
01762 // Operations for class TAO_Unbounded_Abstract_Sequence
01763 // *************************************************************
01764 
01765 // Constructor for unbounded sequence.
01766 template <class T, class T_var>
01767 TAO_Unbounded_Abstract_Sequence<T, T_var>::TAO_Unbounded_Abstract_Sequence (
01768     CORBA::ULong maximum
01769   )
01770   : TAO_Unbounded_Base_Sequence (
01771         maximum,
01772         TAO_Unbounded_Abstract_Sequence<T, T_var>::allocbuf (maximum)
01773       )
01774 {
01775 }
01776 
01777 template <class T, class T_var>
01778 TAO_Unbounded_Abstract_Sequence<T, T_var>::TAO_Unbounded_Abstract_Sequence (
01779     const TAO_Unbounded_Abstract_Sequence<T, T_var> &rhs
01780   )
01781   : TAO_Unbounded_Base_Sequence (rhs)
01782 {
01783   if (rhs.buffer_ != 0)
01784     {
01785       T **tmp1 =
01786         TAO_Unbounded_Abstract_Sequence<T, T_var>::allocbuf (this->maximum_);
01787       T ** const tmp2 =
01788         ACE_reinterpret_cast (T ** ACE_CAST_CONST, 
01789                               rhs.buffer_);
01790 
01791       for (CORBA::ULong i = 0; i < rhs.length_; ++i)
01792         {
01793           tmp1[i] = T_var::tao_duplicate (tmp2[i]);
01794         }
01795 
01796       this->buffer_ = tmp1;
01797     }
01798   else
01799     {
01800       this->buffer_ = 0;
01801     }
01802 }
01803 
01804 template<class T, class T_var>
01805 TAO_Unbounded_Abstract_Sequence<T, T_var>::~TAO_Unbounded_Abstract_Sequence (
01806     void
01807   )
01808 {
01809   this->_deallocate_buffer ();
01810 }
01811 
01812 // assignment operator
01813 template <class T, class T_var>
01814 TAO_Unbounded_Abstract_Sequence<T, T_var>&
01815 TAO_Unbounded_Abstract_Sequence<T, T_var>::operator= (
01816     const TAO_Unbounded_Abstract_Sequence<T, T_var> &rhs
01817   )
01818 {
01819   if (this == &rhs)
01820     {
01821       return *this;
01822     }
01823 
01824   if (this->release_)
01825     {
01826       T **tmp = ACE_reinterpret_cast (T **,
01827                                       this->buffer_);
01828 
01829       for (CORBA::ULong i = 0; i < this->length_; ++i)
01830         {
01831           T_var::tao_release (tmp[i]);
01832           tmp[i] = T_var::tao_nil ();
01833         }
01834 
01835       if (this->maximum_ < rhs.maximum_)
01836         {
01837           TAO_Unbounded_Abstract_Sequence<T, T_var>::freebuf (tmp);
01838           this->buffer_ =
01839             TAO_Unbounded_Abstract_Sequence<T, T_var>::allocbuf (rhs.maximum_);
01840         }
01841     }
01842   else
01843     {
01844       if (rhs.maximum_ == 0)
01845         {
01846           this->buffer_ = 0;
01847         }
01848       else
01849         {
01850           this->buffer_ =
01851             TAO_Unbounded_Abstract_Sequence<T, T_var>::allocbuf (
01852                 rhs.maximum_
01853               );
01854         }
01855     }
01856 
01857   TAO_Unbounded_Base_Sequence::operator= (rhs);
01858 
01859   T **tmp1 = ACE_reinterpret_cast (T **, 
01860                                    this->buffer_);
01861   T ** const tmp2 = ACE_reinterpret_cast (T ** ACE_CAST_CONST, 
01862                                           rhs.buffer_);
01863 
01864   for (CORBA::ULong i = 0; i < rhs.length_; ++i)
01865     {
01866       tmp1[i] = T_var::tao_duplicate (tmp2[i]);
01867     }
01868 
01869   return *this;
01870 }
01871 
01872 template <class T, class T_var> 
01873 T **
01874 TAO_Unbounded_Abstract_Sequence<T, T_var>::allocbuf (CORBA::ULong nelems)
01875 {
01876   T **buf = 0;
01877   ACE_NEW_RETURN (buf, 
01878                   T*[nelems], 
01879                   0);
01880 
01881   for (CORBA::ULong i = 0; i < nelems; i++)
01882     {
01883       buf[i] = T_var::tao_nil ();
01884     }
01885 
01886   return buf;
01887 }
01888 
01889 template <class T, class T_var> 
01890 void
01891 TAO_Unbounded_Abstract_Sequence<T, T_var>::freebuf (T **buffer)
01892 {
01893   if (buffer == 0)
01894     {
01895       return;
01896     }
01897 
01898   // {orbos/97-05-15:16.11} The freebuf function ensures that the
01899   // destructor for each element is called before the buffer is
01900   // destroyed, except for string elements, which are freed using
01901   // string_free(), and object reference elements, which are freed
01902   // using release(). The freebuf function will ignore null pointers
01903   // passed to it.
01904 
01905   // @@ How are we supposed to implement that! We don't know the
01906   // length of the buffer here.
01907   // Mark the length in the first four bytes? For the moment we let
01908   // that be.
01909 
01910   delete [] buffer;
01911 }
01912 
01913 template<class T, class T_var> 
01914 void
01915 TAO_Unbounded_Abstract_Sequence<T, T_var>::_allocate_buffer (
01916     CORBA::ULong length
01917   )
01918 {
01919   T **tmp = TAO_Unbounded_Abstract_Sequence<T, T_var>::allocbuf (length);
01920 
01921   if (this->buffer_ != 0)
01922     {
01923       T **old = ACE_reinterpret_cast (T**, 
01924                                       this->buffer_);
01925 
01926       for (CORBA::ULong i = 0; i < this->length_; ++i)
01927         // Only call duplicate when we did not own the previous
01928         // buffer, since after this method we own it we must also own
01929         // the objects.  If we already own the objects there is no
01930         // need to copy them, if we did we would also have to remove
01931         // the old instances.
01932         if (!this->release_)
01933           {
01934             tmp[i] = T_var::tao_duplicate (old[i]);
01935           }
01936         else
01937           {
01938             tmp[i] = old[i];
01939           }
01940 
01941       if (this->release_)
01942         {
01943           delete [] old;
01944         }
01945     }
01946 
01947   this->buffer_ = tmp;
01948 }
01949 
01950 template<class T, class T_var> void
01951 TAO_Unbounded_Abstract_Sequence<T, T_var>::_deallocate_buffer (void)
01952 {
01953   if (this->buffer_ == 0 || this->release_ == 0)
01954     {
01955       return;
01956     }
01957 
01958   T **tmp = ACE_reinterpret_cast (T**, 
01959                                   this->buffer_);
01960 
01961   for (CORBA::ULong i = 0; i < this->length_; ++i)
01962     {
01963       T_var::tao_release (tmp[i]);
01964       tmp[i] = T_var::tao_nil ();
01965     }
01966 
01967   TAO_Unbounded_Abstract_Sequence<T, T_var>::freebuf (tmp);
01968   this->buffer_ = 0;
01969 }
01970 
01971 template<class T, class T_var> void
01972 TAO_Unbounded_Abstract_Sequence<T ,T_var>::_shrink_buffer (CORBA::ULong nl,
01973                                                            CORBA::ULong ol)
01974 {
01975   T **tmp = ACE_static_cast (T**, 
01976                              this->buffer_);
01977 
01978   for (CORBA::ULong i = nl; i < ol; ++i)
01979     {
01980       T_var::tao_release (tmp[i]);
01981       tmp[i] = T_var::tao_nil ();
01982     }
01983 }
01984 
01985 // *************************************************************
01986 // Operations for class TAO_Bounded_Abstract_Sequence
01987 // *************************************************************
01988 
01989 template <class T, class T_var, size_t MAX>
01990 TAO_Bounded_Abstract_Sequence<T, T_var, MAX>::TAO_Bounded_Abstract_Sequence (
01991     void
01992   )
01993   : TAO_Bounded_Base_Sequence (
01994         MAX,
01995         TAO_Bounded_Abstract_Sequence<T, T_var, MAX>::allocbuf (MAX)
01996       )
01997 {
01998 }
01999 
02000 template <class T, class T_var, size_t MAX>
02001 TAO_Bounded_Abstract_Sequence<T, T_var, MAX>::TAO_Bounded_Abstract_Sequence (
02002     const TAO_Bounded_Abstract_Sequence<T, T_var, MAX> &rhs
02003   )
02004   : TAO_Bounded_Base_Sequence (rhs)
02005 {
02006   if (rhs.buffer_ != 0)
02007     {
02008       T **tmp1 =
02009         TAO_Bounded_Abstract_Sequence<T, T_var, MAX>::allocbuf (MAX);
02010 
02011       T ** const tmp2 =
02012         ACE_reinterpret_cast (T** ACE_CAST_CONST, rhs.buffer_);
02013 
02014       for (CORBA::ULong i = 0; i < rhs.length_; i++)
02015         {
02016           tmp1[i] = T_var::tao_duplicate (tmp2[i]);
02017         }
02018 
02019       this->buffer_ = tmp1;
02020     }
02021   else
02022     {
02023       this->buffer_ = 0;
02024     }
02025 }
02026 
02027 template <class T, class T_var, size_t MAX> 
02028 TAO_Bounded_Abstract_Sequence<T, T_var, MAX>&
02029 TAO_Bounded_Abstract_Sequence<T, T_var, MAX>::operator= (
02030     const TAO_Bounded_Abstract_Sequence<T, T_var, MAX> &rhs
02031   )
02032 {
02033   if (this == &rhs)
02034     {
02035       return *this;
02036     }
02037 
02038   if (this->release_)
02039     {
02040       T **tmp = ACE_reinterpret_cast (T **, 
02041                                       this->buffer_);
02042 
02043       for (CORBA::ULong i = 0; i < this->length_; ++i)
02044         {
02045           T_var::tao_release (tmp[i]);
02046           tmp[i] = T_var::tao_nil ();
02047         }
02048       // No need to reallocate the buffer since it is always of size
02049       // MAX
02050     }
02051   else
02052     {
02053       if (rhs.maximum_ == 0)
02054         {
02055           this->buffer_ = 0;
02056         }
02057       else
02058         {
02059           this->buffer_ =
02060             TAO_Bounded_Abstract_Sequence<T, T_var, MAX>::allocbuf (
02061                 rhs.maximum_
02062               );
02063         }
02064     }
02065 
02066   TAO_Bounded_Base_Sequence::operator= (rhs);
02067 
02068   T **tmp1 = ACE_reinterpret_cast (T **, 
02069                                    this->buffer_);
02070   T ** const tmp2 = ACE_reinterpret_cast (T ** ACE_CAST_CONST, 
02071                                           rhs.buffer_);
02072 
02073   for (CORBA::ULong i=0; i < rhs.length_; ++i)
02074     {
02075       tmp1[i] = T_var::tao_duplicate (tmp2[i]);
02076     }
02077 
02078   return *this;
02079 }
02080 
02081 template <class T, class T_var, size_t MAX> 
02082 T **
02083 TAO_Bounded_Abstract_Sequence<T, T_var, MAX>::allocbuf (CORBA::ULong)
02084 {
02085   T **buf = 0;
02086   ACE_NEW_RETURN (buf, 
02087                   T*[MAX], 
02088                   0);
02089 
02090   for (CORBA::ULong i = 0; i < MAX; ++i)
02091     {
02092       buf[i] = T_var::tao_nil ();
02093     }
02094 
02095   return buf;
02096 }
02097 
02098 template <class T, class T_var, size_t MAX> 
02099 void
02100 TAO_Bounded_Abstract_Sequence<T, T_var, MAX>::freebuf (T **buffer)
02101 {
02102   // How much do we deallocate? Easy! allocbuf() always creates MAX
02103   // elements and initialize them to T::_nil().  So we can be
02104   // complaint and call CORBA::release() on each one.
02105   for (CORBA::ULong i = 0; i < MAX; ++i)
02106     {
02107       if (buffer[i] != T_var::tao_nil ())
02108         {
02109           T_var::tao_release (buffer[i]);
02110           buffer[i] = T_var::tao_nil ();
02111         }
02112     }
02113 
02114   delete [] buffer;
02115 }
02116 
02117 template<class T, class T_var, size_t MAX> 
02118 void
02119 TAO_Bounded_Abstract_Sequence<T, T_var, MAX>::_allocate_buffer (
02120     CORBA::ULong length
02121   )
02122 {
02123   // For this class memory is never reallocated so the implementation
02124   // is *really* simple.
02125   this->buffer_ =
02126     TAO_Bounded_Abstract_Sequence<T, T_var, MAX>::allocbuf (length);
02127 }
02128 
02129 template<class T, class T_var, size_t MAX> 
02130 void
02131 TAO_Bounded_Abstract_Sequence<T, T_var, MAX>::_deallocate_buffer (void)
02132 {
02133   if (this->release_ == 0)
02134     {
02135       return;
02136     }
02137 
02138   T **tmp = ACE_reinterpret_cast (T **, 
02139                                   this->buffer_);
02140   TAO_Bounded_Abstract_Sequence<T, T_var, MAX>::freebuf (tmp);
02141   this->buffer_ = 0;
02142 }
02143 
02144 template<class T, class T_var, size_t MAX> 
02145 void
02146 TAO_Bounded_Abstract_Sequence<T,T_var, MAX>::_shrink_buffer (CORBA::ULong nl,
02147                                                               CORBA::ULong ol)
02148 {
02149   T **tmp = ACE_reinterpret_cast (T **, 
02150                                   this->buffer_);
02151 
02152   for (CORBA::ULong i = nl; i < ol; ++i)
02153     {
02154       T_var::tao_release (tmp[i]);
02155       tmp[i] = T_var::tao_nil ();
02156     }
02157 }
02158 
02159 // *************************************************************
02160 // Operations for class TAO_Unbounded_Array_Sequence
02161 // *************************************************************
02162 
02163 template <class T, class T_var> T *
02164 TAO_Unbounded_Array_Sequence<T, T_var>::allocbuf (CORBA::ULong nelems)
02165 {
02166   T *buf = 0;
02167   ACE_NEW_RETURN (buf,
02168                   T[nelems],
02169                   0);
02170 
02171   return buf;
02172 }
02173 
02174 template <class T, class T_var>
02175 TAO_Unbounded_Array_Sequence<T, T_var>::TAO_Unbounded_Array_Sequence (
02176     const TAO_Unbounded_Array_Sequence<T, T_var> &rhs
02177   )
02178   : TAO_Unbounded_Base_Sequence (rhs)
02179 {
02180   if (rhs.buffer_ != 0)
02181     {
02182       T *tmp1 =
02183         TAO_Unbounded_Array_Sequence<T, T_var>::allocbuf (this->maximum_);
02184 
02185 #if defined (__SUNPRO_CC) && (__SUNPRO_CC < 0x500)
02186       const T *tmp2 = (const T *) rhs.buffer_;
02187 #else /* (__SUNPRO_CC) && (__SUNPRO_CC < 0x500) */
02188       const T *tmp2 = ACE_reinterpret_cast (const T *,
02189                                             rhs.buffer_);
02190 #endif /* (__SUNPRO_CC) && (__SUNPRO_CC < 0x500) */
02191 
02192       for (CORBA::ULong i = 0; i < rhs.length_; ++i)
02193         {
02194           T_var::copy (tmp1[i], tmp2[i]);
02195         }
02196 
02197       this->buffer_ = tmp1;
02198     }
02199   else
02200     {
02201       this->buffer_ = 0;
02202     }
02203 }
02204 
02205 template<class T, class T_var>
02206 TAO_Unbounded_Array_Sequence<T, T_var>::~TAO_Unbounded_Array_Sequence (void)
02207 {
02208   this->_deallocate_buffer ();
02209 }
02210 
02211 // assignment operator
02212 template <class T, class T_var> TAO_Unbounded_Array_Sequence<T, T_var>&
02213 TAO_Unbounded_Array_Sequence<T, T_var>::operator= (
02214     const TAO_Unbounded_Array_Sequence<T, T_var> &rhs
02215   )
02216 {
02217   if (this == &rhs)
02218     {
02219       return *this;
02220     }
02221 
02222   if (this->release_)
02223     {
02224       if (this->maximum_ < rhs.maximum_)
02225         {
02226           // free the old buffer
02227 #if defined (__SUNPRO_CC) && (__SUNPRO_CC < 0x500)
02228           T *tmp = (T *) this->buffer_;
02229 #else /* (__SUNPRO_CC) && (__SUNPRO_CC < 0x500) */
02230           T *tmp = ACE_reinterpret_cast (T *,
02231                                          this->buffer_);
02232 #endif /* (__SUNPRO_CC) && (__SUNPRO_CC < 0x500) */
02233 
02234           TAO_Unbounded_Array_Sequence<T, T_var>::freebuf (tmp);
02235 
02236           if (rhs.maximum_ == 0)
02237             {
02238               this->buffer_ = 0;
02239             }
02240           else
02241             {
02242               this->buffer_ =
02243                 TAO_Unbounded_Array_Sequence<T, T_var>::allocbuf (
02244                     rhs.maximum_
02245                   );
02246             }
02247         }
02248     }
02249   else
02250     {
02251       if (rhs.maximum_ == 0)
02252         {
02253           this->buffer_ = 0;
02254         }
02255       else
02256         {
02257           this->buffer_ =
02258             TAO_Unbounded_Array_Sequence<T,T_var>::allocbuf (rhs.maximum_);
02259         }
02260     }
02261 
02262   TAO_Unbounded_Base_Sequence::operator= (rhs);
02263 
02264   for (CORBA::ULong i = 0; i < rhs.length_; ++i)
02265     {
02266 #if defined (__SUNPRO_CC) && (__SUNPRO_CC < 0x500)
02267       T_var::copy (((T *) this->buffer_)[i],
02268                    ((const T *) rhs.buffer_)[i]);
02269 #else /* (__SUNPRO_CC) && (__SUNPRO_CC < 0x500) */
02270       T_var::copy (ACE_reinterpret_cast (T *,
02271                                          this->buffer_)[i],
02272                    ACE_reinterpret_cast (const T *,
02273                                          rhs.buffer_)[i]);
02274 #endif /* (__SUNPRO_CC) && (__SUNPRO_CC < 0x500) */
02275     }
02276 
02277   return *this;
02278 }
02279 
02280 template<class T, class T_var> void
02281 TAO_Unbounded_Array_Sequence<T, T_var>::_allocate_buffer (CORBA::ULong length)
02282 {
02283   T *tmp = TAO_Unbounded_Array_Sequence<T, T_var>::allocbuf (length);
02284 
02285   if (this->buffer_ != 0)
02286     {
02287 #if defined (__SUNPRO_CC) && (__SUNPRO_CC < 0x500)
02288       T *old = (T *) this->buffer_;
02289 #else /* (__SUNPRO_CC) && (__SUNPRO_CC < 0x500) */
02290       T *old = ACE_reinterpret_cast (T *,
02291                                      this->buffer_);
02292 #endif /* (__SUNPRO_CC) && (__SUNPRO_CC < 0x500) */
02293 
02294       for (CORBA::ULong i = 0; i < this->length_; ++i)
02295         {
02296           T_var::copy (tmp[i], old[i]);
02297         }
02298 
02299       if (this->release_)
02300         {
02301           delete [] old;
02302         }
02303     }
02304 
02305   this->buffer_ = tmp;
02306 }
02307 
02308 template<class T, class T_var> void
02309 TAO_Unbounded_Array_Sequence<T, T_var>::_deallocate_buffer (void)
02310 {
02311   if (this->buffer_ == 0 || this->release_ == 0)
02312     {
02313       return;
02314     }
02315 
02316 #if defined (__SUNPRO_CC) && (__SUNPRO_CC < 0x500)
02317   T *tmp = (T *) this->buffer_;
02318 #else /* (__SUNPRO_CC) && (__SUNPRO_CC < 0x500) */
02319   T *tmp = ACE_reinterpret_cast (T *,
02320                                  this->buffer_);
02321 #endif /* (__SUNPRO_CC) && (__SUNPRO_CC < 0x500) */
02322 
02323   TAO_Unbounded_Array_Sequence<T, T_var>::freebuf (tmp);
02324 
02325   this->buffer_ = 0;
02326 }
02327 
02328 // *************************************************************
02329 // Operations for class TAO_Bounded_Array_Sequence
02330 // *************************************************************
02331 
02332 template <class T, class T_var, size_t MAX> T *
02333 TAO_Bounded_Array_Sequence<T, T_var, MAX>::allocbuf (CORBA::ULong)
02334 {
02335   T *buf = 0;
02336   ACE_NEW_RETURN (buf,
02337                   T[MAX],
02338                   0);
02339 
02340   return buf;
02341 }
02342 
02343 template <class T, class T_var, size_t MAX>
02344 TAO_Bounded_Array_Sequence<T, T_var, MAX>::TAO_Bounded_Array_Sequence (
02345     const TAO_Bounded_Array_Sequence<T, T_var, MAX> &rhs
02346   )
02347   : TAO_Bounded_Base_Sequence (rhs)
02348 {
02349   if (rhs.buffer_ != 0)
02350     {
02351       T *tmp1 =
02352         TAO_Bounded_Array_Sequence<T, T_var, MAX>::allocbuf (MAX);
02353 
02354 #if defined (__SUNPRO_CC) && (__SUNPRO_CC < 0x500)
02355       const T *tmp2 = (const T *) rhs.buffer_;
02356 #else /* (__SUNPRO_CC) && (__SUNPRO_CC < 0x500) */
02357       const T *tmp2 = ACE_reinterpret_cast (const T *,
02358                                             rhs.buffer_);
02359 #endif /* (__SUNPRO_CC) && (__SUNPRO_CC < 0x500) */
02360 
02361       for (CORBA::ULong i = 0; i < rhs.length_; i++)
02362         {
02363           T_var::copy (tmp1[i], tmp2[i]);
02364         }
02365 
02366       this->buffer_ = tmp1;
02367     }
02368   else
02369     {
02370       this->buffer_ = 0;
02371     }
02372 }
02373 
02374 template<class T, class T_var, size_t MAX>
02375 TAO_Bounded_Array_Sequence<T, T_var, MAX>::~TAO_Bounded_Array_Sequence (void)
02376 {
02377   this->_deallocate_buffer ();
02378 }
02379 
02380 template <class T, class T_var, size_t MAX> TAO_Bounded_Array_Sequence<T, T_var, MAX>&
02381 TAO_Bounded_Array_Sequence<T, T_var, MAX>::operator= (
02382     const TAO_Bounded_Array_Sequence<T, T_var, MAX> &rhs
02383   )
02384 {
02385   if (this == &rhs)
02386     {
02387       return *this;
02388     }
02389 
02390   if (this->release_)
02391     {
02392       // We never need to reallocate the buffer because they are
02393       // always of size MAX.
02394     }
02395   else
02396     {
02397       if (rhs.maximum_ == 0)
02398         {
02399           this->buffer_ = 0;
02400         }
02401       else
02402         {
02403           this->buffer_ =
02404             TAO_Bounded_Array_Sequence<T,T_var,MAX>::allocbuf (rhs.maximum_);
02405         }
02406     }
02407 
02408   TAO_Bounded_Base_Sequence::operator= (rhs);
02409 
02410   for (CORBA::ULong i = 0; i < rhs.length_; ++i)
02411     {
02412 #if defined (__SUNPRO_CC) && (__SUNPRO_CC < 0x500)
02413       T_var::copy (((T *) this->buffer_)[i],
02414                    ((const T *) rhs.buffer_)[i]);
02415 #else /* (__SUNPRO_CC) && (__SUNPRO_CC < 0x500) */
02416       T_var::copy (ACE_reinterpret_cast (T *,
02417                                          this->buffer_)[i],
02418                    ACE_reinterpret_cast (const T *,
02419                                          rhs.buffer_)[i]);
02420 #endif /* (__SUNPRO_CC) && (__SUNPRO_CC < 0x500) */
02421     }
02422 
02423   return *this;
02424 }
02425 
02426 template<class T, class T_var, size_t MAX> void
02427 TAO_Bounded_Array_Sequence<T, T_var, MAX>::_allocate_buffer (CORBA::ULong length)
02428 {
02429   // For this class memory is never reallocated so the implementation
02430   // is *really* simple.
02431   this->buffer_ =
02432     TAO_Bounded_Array_Sequence<T, T_var, MAX>::allocbuf (length);
02433 }
02434 
02435 template<class T, class T_var, size_t MAX> void
02436 TAO_Bounded_Array_Sequence<T, T_var, MAX>::_deallocate_buffer (void)
02437 {
02438   if (this->buffer_ == 0 || this->release_ == 0)
02439     {
02440       return;
02441     }
02442 
02443 #if defined (__SUNPRO_CC) && (__SUNPRO_CC < 0x500)
02444   T *tmp = (T *) this->buffer_;
02445 #else /* (__SUNPRO_CC) && (__SUNPRO_CC < 0x500) */
02446   T *tmp = ACE_reinterpret_cast (T *,
02447                                  this->buffer_);
02448 #endif /* (__SUNPRO_CC) && (__SUNPRO_CC < 0x500) */
02449 
02450   TAO_Bounded_Array_Sequence<T, T_var, MAX>::freebuf (tmp);
02451 
02452   this->buffer_ = 0;
02453 }
02454 
02455 // *************************************************************
02456 // Operations for class TAO_Bounded_String_Sequence
02457 // *************************************************************
02458 
02459 template<size_t MAX>
02460 TAO_Bounded_String_Sequence<MAX>::TAO_Bounded_String_Sequence (void)
02461   : TAO_Bounded_Base_Sequence (
02462         MAX,
02463         TAO_Bounded_String_Sequence<MAX>::allocbuf(MAX)
02464       )
02465 {
02466 }
02467 
02468 template<size_t MAX>
02469 TAO_Bounded_String_Sequence<MAX>::TAO_Bounded_String_Sequence (
02470     const TAO_Bounded_String_Sequence<MAX> &rhs
02471   )
02472   : TAO_Bounded_Base_Sequence (rhs)
02473 {
02474   if (rhs.buffer_ != 0)
02475     {
02476       char **tmp1 =
02477         TAO_Bounded_String_Sequence<MAX>::allocbuf (this->maximum_);
02478 
02479       char ** const tmp2 =
02480         ACE_reinterpret_cast (char ** ACE_CAST_CONST,
02481                               rhs.buffer_);
02482 
02483       for (CORBA::ULong i=0; i < rhs.length_; i++)
02484         {
02485           tmp1[i] = CORBA::string_dup (tmp2[i]);
02486         }
02487 
02488       this->buffer_ = tmp1;
02489     }
02490   else
02491     {
02492       this->buffer_ = 0;
02493     }
02494 }
02495 
02496 template<size_t MAX> TAO_Bounded_String_Sequence<MAX>&
02497 TAO_Bounded_String_Sequence<MAX>::operator= (
02498     const TAO_Bounded_String_Sequence<MAX> &rhs
02499   )
02500 {
02501   if (this == &rhs)
02502     {
02503       return *this;
02504     }
02505 
02506   if (this->release_)
02507     {
02508       char **tmp = ACE_reinterpret_cast (char **, 
02509                                          this->buffer_);
02510 
02511       for (CORBA::ULong i = 0; i < this->length_; ++i)
02512         {
02513           CORBA::string_free (tmp[i]);
02514           tmp[i] = 0;
02515         }
02516       // No need to reallocate because the buffer is supposed to be of
02517       // <MAX> size.
02518     }
02519   else
02520     {
02521       if (rhs.maximum_ == 0)
02522         {
02523           this->buffer_ = 0;
02524         }
02525       else
02526         {
02527           this->buffer_ =
02528             TAO_Bounded_String_Sequence<MAX>::allocbuf (rhs.maximum_);
02529         }
02530     }
02531 
02532   TAO_Bounded_Base_Sequence::operator= (rhs);
02533 
02534   char **tmp1 = ACE_reinterpret_cast (char **, 
02535                                       this->buffer_);
02536   char ** const tmp2 = ACE_reinterpret_cast (char ** ACE_CAST_CONST,
02537                                              rhs.buffer_);
02538 
02539   for (CORBA::ULong i = 0; i < rhs.length_; ++i)
02540     {
02541       tmp1[i] = CORBA::string_dup (tmp2[i]);
02542     }
02543 
02544   return *this;
02545 }
02546 
02547 template<size_t MAX> TAO_SeqElem_String_Manager
02548 TAO_Bounded_String_Sequence<MAX>::operator[] (CORBA::ULong slot) const
02549 {
02550   ACE_ASSERT (slot < this->maximum_);
02551   char **const tmp = ACE_reinterpret_cast (char **ACE_CAST_CONST,
02552                                            this->buffer_);
02553   return TAO_SeqElem_String_Manager (tmp + slot,
02554                                      this->release_);
02555 }
02556 
02557 template<size_t MAX> char **
02558 TAO_Bounded_String_Sequence<MAX>::allocbuf (CORBA::ULong)
02559 {
02560   char **buf = 0;
02561   ACE_NEW_RETURN (buf, 
02562                   char *[MAX], 
02563                   0);
02564 
02565   for (CORBA::ULong i = 0; i < MAX; ++i)
02566     {
02567       buf[i] = 0;
02568     }
02569 
02570   return buf;
02571 }
02572 
02573 template<size_t MAX> void
02574 TAO_Bounded_String_Sequence<MAX>::freebuf (char* *buffer)
02575 {
02576   // How much do we deallocate? Easy! <allocbuf> always creates MAX
02577   // elements and initialize them to 0 (they say NULL, yuck!).  So we
02578   // can be complaint and call CORBA::string_free() on each one.
02579 
02580   for (CORBA::ULong i = 0; i < MAX; ++i)
02581     {
02582       if (buffer[i] != 0)
02583         {
02584           CORBA::string_free (buffer[i]);
02585           buffer[i] = 0;
02586         }
02587     }
02588 
02589   delete [] buffer;
02590 }
02591 
02592 template<size_t MAX> void
02593 TAO_Bounded_String_Sequence<MAX>::_allocate_buffer (CORBA::ULong /* length */)
02594 {
02595   // For this class memory is never reallocated so the implementation
02596   // is *really* simple.
02597   this->buffer_ =
02598     TAO_Bounded_String_Sequence<MAX>::allocbuf (MAX);
02599 }
02600 
02601 template<size_t MAX> void
02602 TAO_Bounded_String_Sequence<MAX>::_deallocate_buffer (void)
02603 {
02604   if (this->release_ == 0)
02605     {
02606       return;
02607     }
02608 
02609   char **tmp = ACE_reinterpret_cast (char **, 
02610                                      this->buffer_);
02611   TAO_Bounded_String_Sequence<MAX>::freebuf (tmp);
02612   this->buffer_ = 0;
02613 }
02614 
02615 template<size_t MAX> void
02616 TAO_Bounded_String_Sequence<MAX>::_shrink_buffer (CORBA::ULong nl,
02617                                                   CORBA::ULong ol)
02618 {
02619   char **tmp = ACE_reinterpret_cast (char **,
02620                                      this->buffer_);
02621 
02622   for (CORBA::ULong i = nl; i < ol; ++i)
02623     {
02624       CORBA::string_free (tmp[i]);
02625       tmp[i] = 0;
02626     }
02627 }
02628 
02629 template<size_t MAX> void
02630 TAO_Bounded_String_Sequence<MAX>::replace (CORBA::ULong length,
02631                                            char * *data,
02632                                            CORBA::Boolean release)
02633 {
02634   ACE_ASSERT (length < this->maximum_);
02635   this->_deallocate_buffer ();
02636   this->length_ = length;
02637 
02638   // If 'release' is 1, caller is responsible for allocating new buffer
02639   // with CORBA::string_alloc.
02640   this->buffer_ = data;
02641   this->release_ = release;
02642 }
02643 // *************************************************************
02644 // Operations for class TAO_Bounded_WString_Sequence
02645 // *************************************************************
02646 
02647 template<size_t MAX>
02648 TAO_Bounded_WString_Sequence<MAX>::TAO_Bounded_WString_Sequence (void)
02649   : TAO_Bounded_Base_Sequence (
02650         MAX,
02651         TAO_Bounded_WString_Sequence<MAX>::allocbuf(MAX)
02652       )
02653 {
02654 }
02655 
02656 template<size_t MAX>
02657 TAO_Bounded_WString_Sequence<MAX>::TAO_Bounded_WString_Sequence (
02658     const TAO_Bounded_WString_Sequence<MAX> &rhs
02659   )
02660   : TAO_Bounded_Base_Sequence (rhs)
02661 {
02662   if (rhs.buffer_ != 0)
02663     {
02664       CORBA::WChar **tmp1 =
02665         TAO_Bounded_WString_Sequence<MAX>::allocbuf (this->maximum_);
02666 
02667       CORBA::WChar ** const tmp2 =
02668         ACE_reinterpret_cast (CORBA::WChar ** ACE_CAST_CONST,
02669                               rhs.buffer_);
02670 
02671       for (CORBA::ULong i=0; i < rhs.length_; ++i)
02672         {
02673           tmp1[i] = CORBA::wstring_dup (tmp2[i]);
02674         }
02675 
02676       this->buffer_ = tmp1;
02677     }
02678   else
02679     {
02680       this->buffer_ = 0;
02681     }
02682 }
02683 
02684 template<size_t MAX> TAO_Bounded_WString_Sequence<MAX>&
02685 TAO_Bounded_WString_Sequence<MAX>::operator= (
02686     const TAO_Bounded_WString_Sequence<MAX> &rhs
02687   )
02688 {
02689   if (this == &rhs)
02690     {
02691       return *this;
02692     }
02693 
02694   if (this->release_)
02695     {
02696       CORBA::WChar **tmp = ACE_reinterpret_cast (CORBA::WChar **,
02697                                                  this->buffer_);
02698 
02699       for (CORBA::ULong i = 0; i < this->length_; ++i)
02700         {
02701           CORBA::wstring_free (tmp[i]);
02702           tmp[i] = 0;
02703         }
02704       // No need to reallocate because the buffer is supposed to be of
02705       // <MAX> size.
02706     }
02707   else
02708     {
02709       if (rhs.maximum_ == 0)
02710         {
02711           this->buffer_ = 0;
02712         }
02713       else
02714         {
02715           this->buffer_ =
02716             TAO_Bounded_WString_Sequence<MAX>::allocbuf (rhs.maximum_);
02717         }
02718     }
02719 
02720   TAO_Bounded_Base_Sequence::operator= (rhs);
02721 
02722   CORBA::WChar **tmp1 = ACE_reinterpret_cast (CORBA::WChar **,
02723                                               this->buffer_);
02724   CORBA::WChar ** const tmp2 =
02725     ACE_reinterpret_cast (CORBA::WChar ** ACE_CAST_CONST,
02726                           rhs.buffer_);
02727 
02728   for (CORBA::ULong i = 0; i < rhs.length_; ++i)
02729     {
02730       tmp1[i] = CORBA::wstring_dup (tmp2[i]);
02731     }
02732 
02733   return *this;
02734 }
02735 
02736 template<size_t MAX> TAO_SeqElem_WString_Manager
02737 TAO_Bounded_WString_Sequence<MAX>::operator[] (CORBA::ULong slot) const
02738 {
02739   ACE_ASSERT (slot < this->maximum_);
02740   CORBA::WChar **const tmp =
02741     ACE_reinterpret_cast (CORBA::WChar **ACE_CAST_CONST,
02742                           this->buffer_);
02743   return TAO_SeqElem_WString_Manager (tmp + slot,
02744                                       this->release_);
02745 }
02746 
02747 template<size_t MAX> CORBA::WChar **
02748 TAO_Bounded_WString_Sequence<MAX>::allocbuf (CORBA::ULong)
02749 {
02750   CORBA::WChar **buf = 0;
02751   ACE_NEW_RETURN (buf, 
02752                   CORBA::WChar *[MAX], 
02753                   0);
02754 
02755   for (CORBA::ULong i = 0; i < MAX; ++i)
02756     {
02757       buf[i] = 0;
02758     }
02759 
02760   return buf;
02761 }
02762 
02763 template<size_t MAX> void
02764 TAO_Bounded_WString_Sequence<MAX>::freebuf (CORBA::WChar* *buffer)
02765 {
02766   // How much do we deallocate? Easy! <allocbuf> always creates MAX
02767   // elements and initialize them to 0 (they say NULL, yuck!).  So we
02768   // can be complaint and call CORBA::wstring_free() on each one.
02769 
02770   for (CORBA::ULong i = 0; i < MAX; ++i)
02771     {
02772       if (buffer[i] != 0)
02773         {
02774           CORBA::wstring_free (buffer[i]);
02775           buffer[i] = 0;
02776         }
02777     }
02778 
02779   delete [] buffer;
02780 }
02781 
02782 template<size_t MAX> void
02783 TAO_Bounded_WString_Sequence<MAX>::_allocate_buffer (CORBA::ULong /* length */)
02784 {
02785   // For this class memory is never reallocated so the implementation
02786   // is *really* simple.
02787   this->buffer_ =
02788     TAO_Bounded_WString_Sequence<MAX>::allocbuf (MAX);
02789 }
02790 
02791 template<size_t MAX> void
02792 TAO_Bounded_WString_Sequence<MAX>::_deallocate_buffer (void)
02793 {
02794   if (this->release_ == 0)
02795     {
02796       return;
02797     }
02798 
02799   CORBA::WChar **tmp = ACE_reinterpret_cast (CORBA::WChar **,
02800                                              this->buffer_);
02801   TAO_Bounded_WString_Sequence<MAX>::freebuf (tmp);
02802   this->buffer_ = 0;
02803 }
02804 
02805 template<size_t MAX> void
02806 TAO_Bounded_WString_Sequence<MAX>::_shrink_buffer (CORBA::ULong nl,
02807                                                    CORBA::ULong ol)
02808 {
02809   CORBA::WChar **tmp = ACE_reinterpret_cast (CORBA::WChar **,
02810                                              this->buffer_);
02811 
02812   for (CORBA::ULong i = nl; i < ol; ++i)
02813     {
02814       CORBA::wstring_free (tmp[i]);
02815       tmp[i] = 0;
02816     }
02817 }
02818 
02819 template<size_t MAX> void
02820 TAO_Bounded_WString_Sequence<MAX>::replace (CORBA::ULong length,
02821                                             CORBA::WChar * *data,
02822                                             CORBA::Boolean release)
02823 { 
02824   ACE_ASSERT (length < this->maximum_);
02825   this->_deallocate_buffer ();
02826   this->length_ = length;
02827 
02828   // If 'release' is 1, caller is responsible for allocating new buffer
02829   // with CORBA::wstring_alloc.
02830   this->buffer_ = data;
02831   this->release_ = release;
02832 }
02833 
02834 #endif /* TAO_SEQUENCE_T_C */

Generated on Mon Jun 16 13:49:46 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002