// -*- C++ -*- // // $Id$ #include TAO_BEGIN_VERSIONED_NAMESPACE_DECL template ACE_INLINE void PortableServer::Servant_var::swap (Servant_var & rhs) /* throw () */ { std::swap (this->ptr_, rhs.ptr_); } template ACE_INLINE PortableServer::Servant_var::Servant_var (T * p) : ptr_ (p) { } // If _add_ref throws, this object will not be completely constructed // so the destructor will not be called. template ACE_INLINE PortableServer::Servant_var::Servant_var (Servant_var const & rhs) : ptr_ (Servant_var::_duplicate(rhs.ptr_)) { } template ACE_INLINE PortableServer::Servant_var & PortableServer::Servant_var::operator= (Servant_var const & rhs) { PortableServer::Servant_var tmp (rhs); this->swap (tmp); return *this; } template ACE_INLINE typename PortableServer::Servant_var & PortableServer::Servant_var::operator= (T * p) { if (this->ptr_ != p) { // This constructor doesn't increase the reference count, nor is // it a copy constructor, so we must check for self-assignment. // Otherwise the reference count would be prematurely // decremented upon exiting this scope. PortableServer::Servant_var tmp (p); this->swap (tmp); } return *this; } /* #if !defined(ACE_LACKS_MEMBER_TEMPLATES) template template ACE_INLINE PortableServer::Servant_var::Servant_var (Y * p) : ptr_ (p) { } template template ACE_INLINE PortableServer::Servant_var::Servant_var (Servant_var const & rhs) : ptr_ (Servant_var::_duplicate (rhs.in ())) { } template template ACE_INLINE typename PortableServer::Servant_var & PortableServer::Servant_var::operator=(Servant_var const & rhs) { PortableServer::Servant_var tmp (rhs); this->swap (tmp); return *this; } template template ACE_INLINE typename PortableServer::Servant_var & PortableServer::Servant_var::operator= (Y * p) { if (this->ptr_ != p) { // This constructor doesn't increase the reference count, nor is // it a copy constructor, so we must check for self-assignment. // Otherwise the reference count would be prematurely // decremented upon exiting this scope. PortableServer::Servant_var tmp (p); this->swap (tmp); } return *this; } #endif / * ACE_LACKS_MEMBER_TEMPLATES * / */ template ACE_INLINE T const * PortableServer::Servant_var::operator->() const { return this->ptr_; } template ACE_INLINE T * PortableServer::Servant_var::operator->() { return this->ptr_; } template ACE_INLINE T const & PortableServer::Servant_var::operator*() const { return *this->ptr_; } template ACE_INLINE T & PortableServer::Servant_var::operator*() { return *this->ptr_; } template ACE_INLINE PortableServer::Servant_var::operator void const * () const { return this->ptr_; } template ACE_INLINE T * PortableServer::Servant_var::in (void) const { return this->ptr_; } template ACE_INLINE T *& PortableServer::Servant_var::inout (void) { return this->ptr_; } template ACE_INLINE T *& PortableServer::Servant_var::out (void) { PortableServer::Servant_var tmp; this->swap (tmp); return this->ptr_; } template ACE_INLINE T * PortableServer::Servant_var::_retn (void) { T * const rval = ptr_; this->ptr_ = 0; return rval; } template ACE_INLINE bool operator== (typename PortableServer::Servant_var const & x, typename PortableServer::Servant_var const & y) { return x.in () == y.in (); } template ACE_INLINE bool operator!= (typename PortableServer::Servant_var const & x, typename PortableServer::Servant_var const & y) { return x.in () != y.in (); } TAO_END_VERSIONED_NAMESPACE_DECL