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

ACE_Auto_Basic_Ptr 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:

Inheritance graph
[legend]
Collaboration diagram for ACE_Auto_Basic_Ptr:

Collaboration graph
[legend]
List of all members.

Public Methods

ACE_EXPLICIT 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. More...


Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks. More...


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 44 of file Auto_Ptr.h.


Constructor & Destructor Documentation

template<class X>
ACE_EXPLICIT ACE_Auto_Basic_Ptr< X >::ACE_Auto_Basic_Ptr X *    p = 0 [inline]
 

Definition at line 48 of file Auto_Ptr.h.

References p_.

00048 : 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 7 of file Auto_Ptr.i.

References ACE_TRACE.

00008   : p_ (rhs.release ())
00009 {
00010   ACE_TRACE ("ACE_Auto_Basic_Ptr<X>::ACE_Auto_Basic_Ptr");
00011 }

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

Definition at line 50 of file Auto_Ptr.i.

References ACE_TRACE, and get.

00051 {
00052   ACE_TRACE ("ACE_Auto_Basic_Ptr<X>::~ACE_Auto_Basic_Ptr");
00053   delete this->get ();
00054 }


Member Function Documentation

template<class X>
void ACE_Auto_Basic_Ptr< X >::dump void    const
 

Dump the state of an object.

Definition at line 18 of file Auto_Ptr.cpp.

References ACE_TRACE.

00019 {
00020   ACE_TRACE ("ACE_Auto_Basic_Ptr<X>::dump");
00021 }

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

Definition at line 14 of file Auto_Ptr.i.

References ACE_TRACE, and p_.

Referenced by operator *, auto_ptr::operator->, ACE_Service_Config::process_directive, ACE_Service_Config::process_file, reset, ACE_Thread_Manager::spawn_i, and ~ACE_Auto_Basic_Ptr.

00015 {
00016   ACE_TRACE ("ACE_Auto_Basic_Ptr<X>::get");
00017   return this->p_;
00018 }

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

Definition at line 57 of file Auto_Ptr.i.

References ACE_TRACE, and get.

00058 {
00059   ACE_TRACE ("ACE_Auto_Basic_Ptr<X>::operator *()");
00060   return *this->get ();
00061 }

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 39 of file Auto_Ptr.i.

References ACE_TRACE, release, and reset.

00040 {
00041   ACE_TRACE ("ACE_Auto_Basic_Ptr<X>::operator=");
00042   if (this != &rhs)
00043     {
00044       this->reset (rhs.release ());
00045     }
00046   return *this;
00047 }

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

Definition at line 21 of file Auto_Ptr.i.

References ACE_TRACE, and p_.

Referenced by operator=, ACE_Strong_Bound_Ptr::reset, and ACE_Thread_Manager::spawn_i.

00022 {
00023   ACE_TRACE ("ACE_Auto_Basic_Ptr<X>::release");
00024   X *old = this->p_;
00025   this->p_ = 0;
00026   return old;
00027 }

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

Definition at line 30 of file Auto_Ptr.i.

References ACE_TRACE, get, and p_.

Referenced by operator=, and ACE_Thread_Manager::spawn_i.

00031 {
00032   ACE_TRACE ("ACE_Auto_Basic_Ptr<X>::reset");
00033   if (this->get () != p)
00034     delete this->get ();
00035   this->p_ = p;
00036 }


Member Data Documentation

template<class X>
ACE_Auto_Basic_Ptr::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Definition at line 64 of file Auto_Ptr.h.

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

Definition at line 67 of file Auto_Ptr.h.

Referenced by ACE_Auto_Basic_Ptr, get, release, and reset.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 12:46:00 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002