00001 // -*- C++ -*- 00002 // 00003 // $Id: ORB_Core_Auto_Ptr.inl 69150 2005-11-02 07:13:04Z ossama $ 00004 00005 00006 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00007 00008 ACE_INLINE 00009 TAO_ORB_Core_Auto_Ptr::TAO_ORB_Core_Auto_Ptr (TAO_ORB_Core *p) 00010 : p_ (p) 00011 { 00012 } 00013 00014 ACE_INLINE TAO_ORB_Core * 00015 TAO_ORB_Core_Auto_Ptr::get (void) const 00016 { 00017 return this->p_; 00018 } 00019 00020 ACE_INLINE TAO_ORB_Core * 00021 TAO_ORB_Core_Auto_Ptr::release (void) 00022 { 00023 TAO_ORB_Core *old = this->p_; 00024 this->p_ = 0; 00025 return old; 00026 } 00027 00028 ACE_INLINE TAO_ORB_Core * 00029 TAO_ORB_Core_Auto_Ptr::operator-> () const 00030 { 00031 return this->get (); 00032 } 00033 00034 ACE_INLINE 00035 TAO_ORB_Core_Auto_Ptr::TAO_ORB_Core_Auto_Ptr (TAO_ORB_Core_Auto_Ptr &rhs) 00036 : p_ (rhs.release ()) 00037 { 00038 } 00039 00040 ACE_INLINE TAO_ORB_Core_Auto_Ptr & 00041 TAO_ORB_Core_Auto_Ptr::operator= (TAO_ORB_Core_Auto_Ptr &rhs) 00042 { 00043 if (this != &rhs) 00044 { 00045 this->reset (rhs.release ()); 00046 } 00047 return *this; 00048 } 00049 00050 // Accessor methods to the underlying ORB_Core Object 00051 00052 ACE_INLINE TAO_ORB_Core & 00053 TAO_ORB_Core_Auto_Ptr::operator *() const 00054 { 00055 // @@ Potential problem if this->p_ is zero! 00056 return *this->get (); 00057 } 00058 00059 TAO_END_VERSIONED_NAMESPACE_DECL