diff options
author | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-06-23 08:05:03 +0000 |
---|---|---|
committer | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-06-23 08:05:03 +0000 |
commit | 31d9a45d1387a00a3c04c231d481e3af9a874ee7 (patch) | |
tree | f0131bd31b083c7c7a26da9fb807c6ed9e689859 /ace/Auto_Ptr.i | |
parent | bad20233663443a04c3a334ea5f1534b2e876bdc (diff) | |
download | ATCD-31d9a45d1387a00a3c04c231d481e3af9a874ee7.tar.gz |
*** empty log message ***
Diffstat (limited to 'ace/Auto_Ptr.i')
-rw-r--r-- | ace/Auto_Ptr.i | 109 |
1 files changed, 62 insertions, 47 deletions
diff --git a/ace/Auto_Ptr.i b/ace/Auto_Ptr.i index f0209505c17..9fc759b071d 100644 --- a/ace/Auto_Ptr.i +++ b/ace/Auto_Ptr.i @@ -4,148 +4,163 @@ // Auto_Ptr.i template<class X> ACE_INLINE void -auto_ptr<X>::operator= (auto_ptr<X> &rhs) +auto_basic_ptr<X>::operator= (auto_basic_ptr<X> &rhs) { - ACE_TRACE ("auto_ptr<X>::operator="); + ACE_TRACE ("auto_basic_ptr<X>::operator="); if (this != &rhs) { - auto_ptr<X>::remove (p_); + auto_basic_ptr<X>::remove (p_); p_ = rhs.release (); } } template<class X> ACE_INLINE -auto_ptr<X>::auto_ptr (X *p) +auto_basic_ptr<X>::auto_basic_ptr (X *p) : p_ (p) { - ACE_TRACE ("auto_ptr<X>::auto_ptr"); + ACE_TRACE ("auto_basic_ptr<X>::auto_basic_ptr"); } template<class X> ACE_INLINE -auto_ptr<X>::auto_ptr (auto_ptr<X> &ap) +auto_basic_ptr<X>::auto_basic_ptr (auto_basic_ptr<X> &ap) : p_ (ap.release ()) { - ACE_TRACE ("auto_ptr<X>::auto_ptr"); + ACE_TRACE ("auto_basic_ptr<X>::auto_basic_ptr"); } template<class X> ACE_INLINE -auto_ptr<X>::~auto_ptr (void) +auto_basic_ptr<X>::~auto_basic_ptr (void) { - ACE_TRACE ("auto_ptr<X>::~auto_ptr"); + ACE_TRACE ("auto_basic_ptr<X>::~auto_basic_ptr"); delete p_; } template<class X> ACE_INLINE X & -auto_ptr<X>::operator *() const +auto_basic_ptr<X>::operator *() const { return *p_; } template<class X> ACE_INLINE X * -auto_ptr<X>::operator-> () const -{ - ACE_TRACE ("auto_ptr<X>::operator->"); - return p_; -} - -template<class X> ACE_INLINE X * -auto_ptr<X>::get (void) const +auto_basic_ptr<X>::get (void) const { - ACE_TRACE ("auto_ptr<X>::get"); + ACE_TRACE ("auto_basic_ptr<X>::get"); return p_; } template<class X> ACE_INLINE X * -auto_ptr<X>::release (void) +auto_basic_ptr<X>::release (void) { - ACE_TRACE ("auto_ptr<X>::release"); + ACE_TRACE ("auto_basic_ptr<X>::release"); return this->reset (0); } template<class X> ACE_INLINE X * -auto_ptr<X>::reset (X *p) +auto_basic_ptr<X>::reset (X *p) { - ACE_TRACE ("auto_ptr<X>::reset"); + ACE_TRACE ("auto_basic_ptr<X>::reset"); X *tp = p_; p_ = p; return tp; } template<class X> ACE_INLINE -auto_array_ptr<X>::auto_array_ptr (X *p) +auto_ptr<X>::auto_ptr (X *p) + : auto_basic_ptr<X> (p) +{ + ACE_TRACE ("auto_basic_ptr<X>::auto_basic_ptr"); +} + +template<class X> ACE_INLINE X * +auto_ptr<X>::operator-> () const +{ + ACE_TRACE ("auto_ptr<X>::operator->"); + return p_; +} + +template<class X> ACE_INLINE +auto_basic_array_ptr<X>::auto_basic_array_ptr (X *p) : p_ (p) { - ACE_TRACE ("auto_array_ptr<X>::auto_array_ptr"); + ACE_TRACE ("auto_basic_array_ptr<X>::auto_basic_array_ptr"); } template<class X> ACE_INLINE -auto_array_ptr<X>::auto_array_ptr (auto_array_ptr<X> &ap) +auto_basic_array_ptr<X>::auto_basic_array_ptr (auto_basic_array_ptr<X> &ap) : p_ (ap.release ()) { - ACE_TRACE ("auto_array_ptr<X>::auto_array_ptr"); + ACE_TRACE ("auto_basic_array_ptr<X>::auto_basic_array_ptr"); } template<class X> ACE_INLINE -auto_array_ptr<X>::~auto_array_ptr (void) +auto_basic_array_ptr<X>::~auto_basic_array_ptr (void) { - ACE_TRACE ("auto_array_ptr<X>::~auto_array_ptr"); + ACE_TRACE ("auto_basic_array_ptr<X>::~auto_basic_array_ptr"); delete [] p_; } template<class X> ACE_INLINE X & -auto_array_ptr<X>::operator*() +auto_basic_array_ptr<X>::operator*() { return *p_; } -template<class X> ACE_INLINE X * -auto_array_ptr<X>::operator->() -{ - return p_; -} - template<class X> ACE_INLINE X & -auto_array_ptr<X>::operator[](int i) +auto_basic_array_ptr<X>::operator[](int i) { return p_[i]; } template<class X> ACE_INLINE X -auto_array_ptr<X>::operator[](int i) const +auto_basic_array_ptr<X>::operator[](int i) const { return p_[i]; } template<class X> ACE_INLINE X * -auto_array_ptr<X>::get (void) const +auto_basic_array_ptr<X>::get (void) const { - ACE_TRACE ("auto_array_ptr<X>::get"); + ACE_TRACE ("auto_basic_array_ptr<X>::get"); return p_; } template<class X> ACE_INLINE X * -auto_array_ptr<X>::release (void) +auto_basic_array_ptr<X>::release (void) { - ACE_TRACE ("auto_array_ptr<X>::release"); + ACE_TRACE ("auto_basic_array_ptr<X>::release"); return this->reset (0); } template<class X> ACE_INLINE X * -auto_array_ptr<X>::reset (X *p) +auto_basic_array_ptr<X>::reset (X *p) { - ACE_TRACE ("auto_array_ptr<X>::reset"); + ACE_TRACE ("auto_basic_array_ptr<X>::reset"); X *tp = p_; p_ = p; return tp; } template<class X> ACE_INLINE void -auto_array_ptr<X>::operator= (auto_array_ptr<X> &rhs) +auto_basic_array_ptr<X>::operator= (auto_basic_array_ptr<X> &rhs) { - ACE_TRACE ("auto_array_ptr<X>::operator="); + ACE_TRACE ("auto_basic_array_ptr<X>::operator="); if (this != &rhs) { - auto_array_ptr<X>::remove (p_); + auto_basic_array_ptr<X>::remove (p_); p_ = rhs.release (); } } + +template<class X> ACE_INLINE +auto_array_ptr<X>::auto_array_ptr (X *p) + : auto_basic_array_ptr<T> (p) +{ + ACE_TRACE ("auto_basic_array_ptr<X>::auto_basic_array_ptr"); +} + +template<class X> ACE_INLINE X * +auto_array_ptr<X>::operator->() +{ + return p_; +} + |