summaryrefslogtreecommitdiff
path: root/ACE/TAO/tao/ORB_Core_Auto_Ptr.inl
diff options
context:
space:
mode:
Diffstat (limited to 'ACE/TAO/tao/ORB_Core_Auto_Ptr.inl')
-rw-r--r--ACE/TAO/tao/ORB_Core_Auto_Ptr.inl59
1 files changed, 59 insertions, 0 deletions
diff --git a/ACE/TAO/tao/ORB_Core_Auto_Ptr.inl b/ACE/TAO/tao/ORB_Core_Auto_Ptr.inl
new file mode 100644
index 00000000000..d9bd041e77c
--- /dev/null
+++ b/ACE/TAO/tao/ORB_Core_Auto_Ptr.inl
@@ -0,0 +1,59 @@
+// -*- C++ -*-
+//
+// $Id$
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_ORB_Core_Auto_Ptr::TAO_ORB_Core_Auto_Ptr (TAO_ORB_Core *p)
+ : p_ (p)
+{
+}
+
+ACE_INLINE TAO_ORB_Core *
+TAO_ORB_Core_Auto_Ptr::get (void) const
+{
+ return this->p_;
+}
+
+ACE_INLINE TAO_ORB_Core *
+TAO_ORB_Core_Auto_Ptr::release (void)
+{
+ TAO_ORB_Core *old = this->p_;
+ this->p_ = 0;
+ return old;
+}
+
+ACE_INLINE TAO_ORB_Core *
+TAO_ORB_Core_Auto_Ptr::operator-> () const
+{
+ return this->get ();
+}
+
+ACE_INLINE
+TAO_ORB_Core_Auto_Ptr::TAO_ORB_Core_Auto_Ptr (TAO_ORB_Core_Auto_Ptr &rhs)
+ : p_ (rhs.release ())
+{
+}
+
+ACE_INLINE TAO_ORB_Core_Auto_Ptr &
+TAO_ORB_Core_Auto_Ptr::operator= (TAO_ORB_Core_Auto_Ptr &rhs)
+{
+ if (this != &rhs)
+ {
+ this->reset (rhs.release ());
+ }
+ return *this;
+}
+
+// Accessor methods to the underlying ORB_Core Object
+
+ACE_INLINE TAO_ORB_Core &
+TAO_ORB_Core_Auto_Ptr::operator *() const
+{
+ // @@ Potential problem if this->p_ is zero!
+ return *this->get ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL