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

ACE_Auto_Basic_Array_Ptr Class Template Reference

Implements an extension to the draft C++ standard auto_ptr abstraction. This class allows one to work on non-object (basic) types that must be treated as an array, e.g., deallocated via "delete [] foo". More...

#include <Auto_Ptr.h>

Inheritance diagram for ACE_Auto_Basic_Array_Ptr:

Inheritance graph
[legend]
Collaboration diagram for ACE_Auto_Basic_Array_Ptr:

Collaboration graph
[legend]
List of all members.

Public Methods

ACE_EXPLICIT ACE_Auto_Basic_Array_Ptr (X *p=0)
 ACE_Auto_Basic_Array_Ptr (ACE_Auto_Basic_Array_Ptr< X > &ap)
ACE_Auto_Basic_Array_Ptr<
X > & 
operator= (ACE_Auto_Basic_Array_Ptr< X > &rhs)
 ~ACE_Auto_Basic_Array_Ptr (void)
X & operator * () const
X & operator[] (int i) 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_Array_Ptr< X >

Implements an extension to the draft C++ standard auto_ptr abstraction. This class allows one to work on non-object (basic) types that must be treated as an array, e.g., deallocated via "delete [] foo".

Definition at line 106 of file Auto_Ptr.h.


Constructor & Destructor Documentation

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

Definition at line 110 of file Auto_Ptr.h.

References p_.

00110 : p_ (p) {}

template<class X>
ACE_INLINE ACE_Auto_Basic_Array_Ptr< X >::ACE_Auto_Basic_Array_Ptr ACE_Auto_Basic_Array_Ptr< X > &    ap
 

Definition at line 102 of file Auto_Ptr.i.

References ACE_TRACE.

00103   : p_ (rhs.release ())
00104 {
00105   ACE_TRACE ("ACE_Auto_Basic_Array_Ptr<X>::ACE_Auto_Basic_Array_Ptr");
00106 }

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

Definition at line 120 of file Auto_Ptr.i.

References ACE_TRACE, and get.

00121 {
00122   ACE_TRACE ("ACE_Auto_Basic_Array_Ptr<X>::~ACE_Auto_Basic_Array_Ptr");
00123   delete [] this->get ();
00124 }


Member Function Documentation

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

Dump the state of an object.

Definition at line 26 of file Auto_Ptr.cpp.

References ACE_TRACE.

00027 {
00028   ACE_TRACE ("ACE_Auto_Basic_Array_Ptr<X>::dump");
00029 }

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

Definition at line 77 of file Auto_Ptr.i.

References ACE_TRACE, and p_.

Referenced by ACE_Local_Memory_Pool::acquire, ACE_Remote_Name_Space::bind, ACE_Configuration::expand_path, ACE_Sock_Connect::get_ip_interfaces, ACE_Remote_Name_Space::list_name_entries, ACE_Remote_Name_Space::list_names, ACE_Remote_Name_Space::list_type_entries, ACE_Remote_Name_Space::list_types, ACE_Remote_Name_Space::list_value_entries, ACE_Remote_Name_Space::list_values, operator *, ACE_Auto_Array_Ptr::operator->, operator[], ACE_Remote_Name_Space::rebind, reset, ACE_Remote_Name_Space::resolve, ACE_Local_Name_Space::shared_bind_i, ACE_DLL_Handle::symbol, ACE_Remote_Name_Space::unbind, and ~ACE_Auto_Basic_Array_Ptr.

00078 {
00079   ACE_TRACE ("ACE_Auto_Basic_Array_Ptr<X>::get");
00080   return this->p_;
00081 }

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

Definition at line 127 of file Auto_Ptr.i.

References get.

00128 {
00129   return *this->get ();
00130 }

template<class X>
ACE_INLINE ACE_Auto_Basic_Array_Ptr< X > & ACE_Auto_Basic_Array_Ptr< X >::operator= ACE_Auto_Basic_Array_Ptr< X > &    rhs
 

Definition at line 109 of file Auto_Ptr.i.

References ACE_TRACE, release, and reset.

00110 {
00111   ACE_TRACE ("ACE_Auto_Basic_Array_Ptr<X>::operator=");
00112   if (this != &rhs)
00113     {
00114       this->reset (rhs.release ());
00115     }
00116   return *this;
00117 }

template<class X>
ACE_INLINE X & ACE_Auto_Basic_Array_Ptr< X >::operator[] int    i const
 

Definition at line 133 of file Auto_Ptr.i.

References get.

00134 {
00135   X *array = this->get ();
00136   return array[i];
00137 }

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

Definition at line 84 of file Auto_Ptr.i.

References ACE_TRACE, and p_.

Referenced by ACE_Local_Memory_Pool::acquire, and operator=.

00085 {
00086   ACE_TRACE ("ACE_Auto_Basic_Array_Ptr<X>::release");
00087   X *old = this->p_;
00088   this->p_ = 0;
00089   return old;
00090 }

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

Definition at line 93 of file Auto_Ptr.i.

References ACE_TRACE, get, and p_.

Referenced by operator=.

00094 {
00095   ACE_TRACE ("ACE_Auto_Basic_Array_Ptr<X>::reset");
00096   if (this->get () != p)
00097     delete [] this->get ();
00098   this->p_ = p;
00099 }


Member Data Documentation

template<class X>
ACE_Auto_Basic_Array_Ptr::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Definition at line 127 of file Auto_Ptr.h.

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

Definition at line 130 of file Auto_Ptr.h.

Referenced by ACE_Auto_Basic_Array_Ptr, get, release, and reset.


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