Define a TAO_ORB_Core auto_ptr class. More...
#include <ORB_Core_Auto_Ptr.h>
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_Ptr & | operator= (TAO_ORB_Core_Auto_Ptr &rhs) |
~TAO_ORB_Core_Auto_Ptr (void) | |
Accessor methods. | |
TAO_ORB_Core & | operator* () const |
TAO_ORB_Core * | get (void) const |
TAO_ORB_Core * | release (void) |
void | reset (TAO_ORB_Core *p=0) |
TAO_ORB_Core * | operator-> () const |
Protected Attributes | |
TAO_ORB_Core * | p_ |
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.
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.
: p_ (p) { }
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.
: p_ (rhs.release ()) { }
TAO_ORB_Core_Auto_Ptr::~TAO_ORB_Core_Auto_Ptr | ( | void | ) |
Definition at line 14 of file ORB_Core_Auto_Ptr.cpp.
{ if (this->get () != 0) { this->get ()->_decr_refcnt (); } }
TAO_ORB_Core * TAO_ORB_Core_Auto_Ptr::get | ( | void | ) | const |
Definition at line 15 of file ORB_Core_Auto_Ptr.inl.
{ return this->p_; }
TAO_ORB_Core & TAO_ORB_Core_Auto_Ptr::operator* | ( | void | ) | const |
Definition at line 53 of file ORB_Core_Auto_Ptr.inl.
{ // @@ Potential problem if this->p_ is zero! return *this->get (); }
TAO_ORB_Core * TAO_ORB_Core_Auto_Ptr::operator-> | ( | void | ) | const |
Definition at line 29 of file ORB_Core_Auto_Ptr.inl.
{ return this->get (); }
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.
TAO_ORB_Core * TAO_ORB_Core_Auto_Ptr::release | ( | void | ) |
Definition at line 21 of file ORB_Core_Auto_Ptr.inl.
{ TAO_ORB_Core *old = this->p_; this->p_ = 0; return old; }
void TAO_ORB_Core_Auto_Ptr::reset | ( | TAO_ORB_Core * | p = 0 |
) |
Definition at line 23 of file ORB_Core_Auto_Ptr.cpp.
{ if (this->get () != p && this->get () != 0) { this->get ()->_decr_refcnt (); } this->p_ = p; }
TAO_ORB_Core* TAO_ORB_Core_Auto_Ptr::p_ [protected] |
Definition at line 66 of file ORB_Core_Auto_Ptr.h.