TAO_ORB_Core_Auto_Ptr Class Reference

Define a TAO_ORB_Core auto_ptr class. More...

#include <ORB_Core_Auto_Ptr.h>

Collaboration diagram for TAO_ORB_Core_Auto_Ptr:

Collaboration graph
[legend]
List of all members.

Public Member Functions

Initialization and termination methods
 TAO_ORB_Core_Auto_Ptr (TAO_ORB_Core *p=0)
 TAO_ORB_Core_Auto_Ptr (TAO_ORB_Core_Auto_Ptr &ap)
TAO_ORB_Core_Auto_Ptroperator= (TAO_ORB_Core_Auto_Ptr &rhs)
 ~TAO_ORB_Core_Auto_Ptr (void)
Accessor methods.
TAO_ORB_Coreoperator * () const
TAO_ORB_Coreget (void) const
TAO_ORB_Corerelease (void)
void reset (TAO_ORB_Core *p=0)
TAO_ORB_Coreoperator-> () const

Protected Attributes

TAO_ORB_Corep_

Detailed Description

Define a TAO_ORB_Core auto_ptr class.

This class is used as an aid to make ORB initialization exception safe. It ensures that the ORB core is deallocated through its reference counting mechanism if an exception is thrown.

Definition at line 40 of file ORB_Core_Auto_Ptr.h.


Constructor & Destructor Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE TAO_ORB_Core_Auto_Ptr::TAO_ORB_Core_Auto_Ptr TAO_ORB_Core p = 0  )  [explicit]
 

Definition at line 9 of file ORB_Core_Auto_Ptr.inl.

00010   : p_ (p)
00011 {
00012 }

ACE_INLINE TAO_ORB_Core_Auto_Ptr::TAO_ORB_Core_Auto_Ptr TAO_ORB_Core_Auto_Ptr ap  ) 
 

Definition at line 35 of file ORB_Core_Auto_Ptr.inl.

00036   : p_ (rhs.release ())
00037 {
00038 }

TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_ORB_Core_Auto_Ptr::~TAO_ORB_Core_Auto_Ptr void   ) 
 

Definition at line 14 of file ORB_Core_Auto_Ptr.cpp.

References TAO_ORB_Core::_decr_refcnt(), and get().

00015 {
00016   if (this->get () != 0)
00017     {
00018       this->get ()->_decr_refcnt ();
00019     }
00020 }


Member Function Documentation

ACE_INLINE TAO_ORB_Core * TAO_ORB_Core_Auto_Ptr::get void   )  const
 

Definition at line 15 of file ORB_Core_Auto_Ptr.inl.

Referenced by TAO_ORB_Core::create_object(), TAO_ORB_Core::initialize_object_i(), operator *(), operator->(), TAO_Stub::orb_core(), CORBA::ORB_init(), reset(), TAO_Stub::TAO_Stub(), and ~TAO_ORB_Core_Auto_Ptr().

00016 {
00017   return this->p_;
00018 }

ACE_INLINE TAO_ORB_Core & TAO_ORB_Core_Auto_Ptr::operator *  )  const
 

Definition at line 53 of file ORB_Core_Auto_Ptr.inl.

References get().

00054 {
00055   // @@ Potential problem if this->p_ is zero!
00056   return *this->get ();
00057 }

ACE_INLINE TAO_ORB_Core * TAO_ORB_Core_Auto_Ptr::operator->  )  const
 

Definition at line 29 of file ORB_Core_Auto_Ptr.inl.

References get().

00030 {
00031   return this->get ();
00032 }

ACE_INLINE TAO_ORB_Core_Auto_Ptr & TAO_ORB_Core_Auto_Ptr::operator= TAO_ORB_Core_Auto_Ptr rhs  ) 
 

Definition at line 41 of file ORB_Core_Auto_Ptr.inl.

References release(), and reset().

00042 {
00043   if (this != &rhs)
00044     {
00045       this->reset (rhs.release ());
00046     }
00047   return *this;
00048 }

ACE_INLINE TAO_ORB_Core * TAO_ORB_Core_Auto_Ptr::release void   ) 
 

Definition at line 21 of file ORB_Core_Auto_Ptr.inl.

Referenced by operator=().

00022 {
00023   TAO_ORB_Core *old = this->p_;
00024   this->p_ = 0;
00025   return old;
00026 }

void TAO_ORB_Core_Auto_Ptr::reset TAO_ORB_Core p = 0  ) 
 

Definition at line 23 of file ORB_Core_Auto_Ptr.cpp.

References TAO_ORB_Core::_decr_refcnt(), and get().

Referenced by operator=(), CORBA::ORB_init(), and TAO_Stub::TAO_Stub().

00024 {
00025   if (this->get () != p && this->get () != 0)
00026     {
00027       this->get ()->_decr_refcnt ();
00028     }
00029 
00030   this->p_ = p;
00031 }


Member Data Documentation

TAO_ORB_Core* TAO_ORB_Core_Auto_Ptr::p_ [protected]
 

Definition at line 67 of file ORB_Core_Auto_Ptr.h.


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 12:22:48 2006 for TAO by doxygen 1.3.6