ACE_Auto_Basic_Ptr< X > Class Template Reference

Implements the draft C++ standard auto_ptr abstraction. This class allows one to work on non-object (basic) types. More...

#include <Auto_Ptr.h>

Inheritance diagram for ACE_Auto_Basic_Ptr< X >:

Inheritance graph
[legend]
Collaboration diagram for ACE_Auto_Basic_Ptr< X >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ACE_Auto_Basic_Ptr (X *p=0)
 ACE_Auto_Basic_Ptr (ACE_Auto_Basic_Ptr< X > &ap)
ACE_Auto_Basic_Ptr< X > & operator= (ACE_Auto_Basic_Ptr< X > &rhs)
 ~ACE_Auto_Basic_Ptr (void)
X & operator * () const
X * get (void) const
X * release (void)
void reset (X *p=0)
void dump (void) const
 Dump the state of an object.


Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.


Protected Attributes

X * p_

Detailed Description

template<class X>
class ACE_Auto_Basic_Ptr< X >

Implements the draft C++ standard auto_ptr abstraction. This class allows one to work on non-object (basic) types.

Definition at line 45 of file Auto_Ptr.h.


Constructor & Destructor Documentation

template<class X>
ACE_Auto_Basic_Ptr< X >::ACE_Auto_Basic_Ptr X *  p = 0  )  [inline, explicit]
 

Definition at line 49 of file Auto_Ptr.h.

00049 : p_ (p) {}

template<class X>
ACE_INLINE ACE_Auto_Basic_Ptr< X >::ACE_Auto_Basic_Ptr ACE_Auto_Basic_Ptr< X > &  ap  ) 
 

Definition at line 26 of file Auto_Ptr.inl.

References ACE_TRACE.

00027   : p_ (rhs.release ())
00028 {
00029   ACE_TRACE ("ACE_Auto_Basic_Ptr<X>::ACE_Auto_Basic_Ptr");
00030 }

template<class X>
ACE_INLINE ACE_Auto_Basic_Ptr< X >::~ACE_Auto_Basic_Ptr void   ) 
 

Definition at line 69 of file Auto_Ptr.inl.

References ACE_TRACE, and ACE_Auto_Basic_Ptr< X >::get().

00070 {
00071   ACE_TRACE ("ACE_Auto_Basic_Ptr<X>::~ACE_Auto_Basic_Ptr");
00072   delete this->get ();
00073 }


Member Function Documentation

template<class X>
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE void ACE_Auto_Basic_Ptr< X >::dump void   )  const
 

Dump the state of an object.

Definition at line 10 of file Auto_Ptr.inl.

References ACE_TRACE.

00011 {
00012 #if defined (ACE_HAS_DUMP)
00013   ACE_TRACE ("ACE_Auto_Basic_Ptr<X>::dump");
00014 #endif /* ACE_HAS_DUMP */
00015 }

template<class X>
ACE_INLINE X * ACE_Auto_Basic_Ptr< X >::get void   )  const
 

Definition at line 33 of file Auto_Ptr.inl.

References ACE_TRACE.

Referenced by ACE_Service_Gestalt::initialize(), ACE_Auto_Basic_Ptr< X >::operator *(), ACE_Auto_Ptr< X >::operator->(), auto_ptr< X >::operator->(), ACE_Service_Gestalt::process_directive(), ACE_Service_Gestalt::process_file(), ACE_Auto_Basic_Ptr< X >::reset(), ACE_Thread_Manager::spawn_i(), and ACE_Auto_Basic_Ptr< X >::~ACE_Auto_Basic_Ptr().

00034 {
00035   ACE_TRACE ("ACE_Auto_Basic_Ptr<X>::get");
00036   return this->p_;
00037 }

template<class X>
ACE_INLINE X & ACE_Auto_Basic_Ptr< X >::operator *  )  const
 

Definition at line 76 of file Auto_Ptr.inl.

References ACE_TRACE, and ACE_Auto_Basic_Ptr< X >::get().

00077 {
00078   ACE_TRACE ("ACE_Auto_Basic_Ptr<X>::operator *()");
00079   return *this->get ();
00080 }

template<class X>
ACE_INLINE ACE_Auto_Basic_Ptr< X > & ACE_Auto_Basic_Ptr< X >::operator= ACE_Auto_Basic_Ptr< X > &  rhs  ) 
 

Definition at line 58 of file Auto_Ptr.inl.

References ACE_TRACE, ACE_Auto_Basic_Ptr< X >::release(), and ACE_Auto_Basic_Ptr< X >::reset().

00059 {
00060   ACE_TRACE ("ACE_Auto_Basic_Ptr<X>::operator=");
00061   if (this != &rhs)
00062     {
00063       this->reset (rhs.release ());
00064     }
00065   return *this;
00066 }

template<class X>
ACE_INLINE X * ACE_Auto_Basic_Ptr< X >::release void   ) 
 

Definition at line 40 of file Auto_Ptr.inl.

References ACE_TRACE.

Referenced by ACE_Service_Gestalt::initialize(), ACE_Auto_Basic_Ptr< X >::operator=(), ACE_Strong_Bound_Ptr< X, ACE_LOCK >::reset(), ACE_Thread_Manager::spawn_i(), ACE_OS::thr_create(), and ACE_Proactor_Handle_Timeout_Upcall::timeout().

00041 {
00042   ACE_TRACE ("ACE_Auto_Basic_Ptr<X>::release");
00043   X *old = this->p_;
00044   this->p_ = 0;
00045   return old;
00046 }

template<class X>
ACE_INLINE void ACE_Auto_Basic_Ptr< X >::reset X *  p = 0  ) 
 

Definition at line 49 of file Auto_Ptr.inl.

References ACE_TRACE, and ACE_Auto_Basic_Ptr< X >::get().

Referenced by ACE_Auto_Basic_Ptr< X >::operator=(), and ACE_Thread_Manager::spawn_i().

00050 {
00051   ACE_TRACE ("ACE_Auto_Basic_Ptr<X>::reset");
00052   if (this->get () != p)
00053     delete this->get ();
00054   this->p_ = p;
00055 }


Member Data Documentation

template<class X>
ACE_Auto_Basic_Ptr< X >::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Definition at line 65 of file Auto_Ptr.h.

template<class X>
X* ACE_Auto_Basic_Ptr< X >::p_ [protected]
 

Definition at line 68 of file Auto_Ptr.h.


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 11:20:13 2006 for ACE by doxygen 1.3.6