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

TAO_ORB_Core_Auto_Ptr Class Reference

Define a TAO_ORB_Core auto_ptr class. More...

#include <ORB_Core.h>

Collaboration diagram for TAO_ORB_Core_Auto_Ptr:

Collaboration graph
[legend]
List of all members.

Public 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_Ptr & operator= (TAO_ORB_Core_Auto_Ptr &rhs)
 ~TAO_ORB_Core_Auto_Ptr (void)
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 if an exception is thrown.

Todo:
TAO_ORB_Core_Auto_Ptr should be renamed to TAO_ORB_Core_var since the ORB Core is reference counted.

Definition at line 1386 of file ORB_Core.h.


Constructor & Destructor Documentation

ACE_INLINE TAO_ORB_Core_Auto_Ptr::TAO_ORB_Core_Auto_Ptr TAO_ORB_Core   p = 0
 

Definition at line 626 of file ORB_Core.i.

References ACE_TRACE.

00627   : p_ (p)
00628 {
00629   ACE_TRACE ("TAO_ORB_Core_Auto_Ptr::TAO_ORB_Core_Auto_Ptr");
00630 }

ACE_INLINE TAO_ORB_Core_Auto_Ptr::TAO_ORB_Core_Auto_Ptr TAO_ORB_Core_Auto_Ptr &    ap
 

Definition at line 665 of file ORB_Core.i.

References ACE_TRACE.

00666   : p_ (rhs.release ())
00667 {
00668   ACE_TRACE ("TAO_ORB_Core_Auto_Ptr::TAO_ORB_Core_Auto_Ptr");
00669 }

ACE_INLINE TAO_ORB_Core_Auto_Ptr::~TAO_ORB_Core_Auto_Ptr void   
 

Definition at line 683 of file ORB_Core.i.

References TAO_ORB_Core::_decr_refcnt, ACE_TRACE, and get.

00684 {
00685   ACE_TRACE ("TAO_ORB_Core_Auto_Ptr::~TAO_ORB_Core_Auto_Ptr");
00686   if (this->get() != 0)
00687     this->get ()->_decr_refcnt ();
00688 }


Member Function Documentation

ACE_INLINE TAO_ORB_Core * TAO_ORB_Core_Auto_Ptr::get void    const
 

Definition at line 633 of file ORB_Core.i.

References ACE_TRACE, and p_.

Referenced by operator *, operator->, TAO_Stub::orb_core, reset, TAO_Stub::TAO_Stub, and ~TAO_ORB_Core_Auto_Ptr.

00634 {
00635   ACE_TRACE ("TAO_ORB_Core_Auto_Ptr::get");
00636   return this->p_;
00637 }

ACE_INLINE TAO_ORB_Core & TAO_ORB_Core_Auto_Ptr::operator *   const
 

Definition at line 693 of file ORB_Core.i.

References ACE_TRACE, and get.

00694 {
00695   ACE_TRACE ("TAO_ORB_Core_Auto_Ptr::operator *()");
00696   // @@ Potential problem if this->p_ is zero!
00697   return *this->get ();
00698 }

ACE_INLINE TAO_ORB_Core * TAO_ORB_Core_Auto_Ptr::operator->   const
 

Definition at line 658 of file ORB_Core.i.

References ACE_TRACE, and get.

00659 {
00660   ACE_TRACE ("TAO_ORB_Core_Auto_Ptr::operator->");
00661   return this->get ();
00662 }

ACE_INLINE TAO_ORB_Core_Auto_Ptr & TAO_ORB_Core_Auto_Ptr::operator= TAO_ORB_Core_Auto_Ptr &    rhs
 

Definition at line 672 of file ORB_Core.i.

References ACE_TRACE, release, and reset.

00673 {
00674   ACE_TRACE ("TAO_ORB_Core_Auto_Ptr::operator=");
00675   if (this != &rhs)
00676     {
00677       this->reset (rhs.release ());
00678     }
00679   return *this;
00680 }

ACE_INLINE TAO_ORB_Core * TAO_ORB_Core_Auto_Ptr::release void   
 

Definition at line 640 of file ORB_Core.i.

References ACE_TRACE, and p_.

Referenced by operator=.

00641 {
00642   ACE_TRACE ("TAO_ORB_Core_Auto_Ptr::release");
00643   TAO_ORB_Core *old = this->p_;
00644   this->p_ = 0;
00645   return old;
00646 }

ACE_INLINE void TAO_ORB_Core_Auto_Ptr::reset TAO_ORB_Core   p = 0
 

Definition at line 649 of file ORB_Core.i.

References TAO_ORB_Core::_decr_refcnt, ACE_TRACE, get, and p_.

Referenced by operator=, and TAO_Stub::TAO_Stub.

00650 {
00651   ACE_TRACE ("TAO_ORB_Core_Auto_Ptr::reset");
00652   if (this->get () != p && this->get () != 0)
00653     this->get ()->_decr_refcnt ();
00654   this->p_ = p;
00655 }


Member Data Documentation

TAO_ORB_Core* TAO_ORB_Core_Auto_Ptr::p_ [protected]
 

Definition at line 1409 of file ORB_Core.h.

Referenced by get, release, and reset.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 15:31:06 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002