diff options
author | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-07-15 16:39:52 +0000 |
---|---|---|
committer | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-07-15 16:39:52 +0000 |
commit | 2325b338766316babe9c0343e378fa3a24c9f32b (patch) | |
tree | db208a2657302e9308ef1fb6157ce6059f1a65fb /TAO/tao/Object.i | |
parent | 9f29df04f390576fd4ff1c68d9a006ff543b46a5 (diff) | |
download | ATCD-2325b338766316babe9c0343e378fa3a24c9f32b.tar.gz |
This commit was manufactured by cvs2svn to create tag 'ACE-4_6_45'.ACE-4_6_45
Diffstat (limited to 'TAO/tao/Object.i')
-rw-r--r-- | TAO/tao/Object.i | 235 |
1 files changed, 0 insertions, 235 deletions
diff --git a/TAO/tao/Object.i b/TAO/tao/Object.i deleted file mode 100644 index ba601235b64..00000000000 --- a/TAO/tao/Object.i +++ /dev/null @@ -1,235 +0,0 @@ -// $Id$ - -// **************************************************************** - -ACE_INLINE CORBA::ULong -CORBA_Object::_incr_refcnt (void) -{ - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, guard, this->refcount_lock_, 0); - return this->refcount_++; -} - -ACE_INLINE CORBA::ULong -CORBA_Object::_decr_refcnt (void) -{ - { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, mon, this->refcount_lock_, 0); - this->refcount_--; - if (this->refcount_ != 0) - return this->refcount_; - } - - delete this; - return 0; -} - -ACE_INLINE CORBA_Object_ptr -CORBA_Object::_duplicate (CORBA_Object_ptr obj) -{ - if (obj) - obj->_incr_refcnt (); - return obj; -} - -// Null pointers represent nil objects. - -ACE_INLINE CORBA_Object_ptr -CORBA_Object::_nil (void) -{ - return 0; -} - -ACE_INLINE CORBA_Object_ptr -CORBA_Object::_narrow (CORBA_Object_ptr obj, CORBA::Environment&) -{ - return CORBA_Object::_duplicate (obj); -} - -ACE_INLINE TAO_Stub * -CORBA_Object::_stubobj (void) const -{ - return this->protocol_proxy_; -} - -// ************************************************************ -// These are in CORBA namespace - -ACE_INLINE CORBA::Boolean -CORBA::is_nil (CORBA::Object_ptr obj) -{ - return obj == 0; -} - -ACE_INLINE void -CORBA::release (CORBA_Object_ptr obj) -{ - if (obj) - obj->_decr_refcnt (); -} - -// DII hook to objref -// -// The mapping for create_request is split into two forms, -// corresponding to the two usage styles described in CORBA section -// 6.2.1. - -// ************************************************************* -// Inline operations for class CORBA_Object_var -// ************************************************************* - -ACE_INLINE -CORBA_Object_var::CORBA_Object_var (void) - : ptr_ (CORBA_Object::_nil ()) -{ -} - -ACE_INLINE -CORBA_Object_var::CORBA_Object_var (CORBA_Object_ptr p) - : ptr_ (p) -{} - -ACE_INLINE -CORBA_Object_var::~CORBA_Object_var (void) -{ - CORBA::release (this->ptr_); -} - -ACE_INLINE CORBA_Object_ptr -CORBA_Object_var::ptr (void) const -{ - return this->ptr_; -} - -ACE_INLINE -CORBA_Object_var::CORBA_Object_var (const CORBA_Object_var &p) // copy constructor - : ptr_ (CORBA_Object::_duplicate (p.ptr ())) -{} - -ACE_INLINE CORBA_Object_var & -CORBA_Object_var::operator= (CORBA_Object_ptr p) -{ - CORBA::release (this->ptr_); - this->ptr_ = p; - return *this; -} - -ACE_INLINE CORBA_Object_var & -CORBA_Object_var::operator= (const CORBA_Object_var &p) -{ - if (this != &p) - { - CORBA::release (this->ptr_); - this->ptr_ = CORBA_Object::_duplicate (p.ptr ()); - } - return *this; -} - -ACE_INLINE -CORBA_Object_var::operator const CORBA_Object_ptr &() const // cast -{ - return this->ptr_; -} - -ACE_INLINE -CORBA_Object_var::operator CORBA_Object_ptr &() // cast -{ - return this->ptr_; -} - -ACE_INLINE CORBA_Object_ptr -CORBA_Object_var::operator-> (void) const -{ - return this->ptr_; -} - -ACE_INLINE CORBA_Object_ptr -CORBA_Object_var::in (void) const -{ - return this->ptr_; -} - -ACE_INLINE CORBA_Object_ptr & -CORBA_Object_var::inout (void) -{ - return this->ptr_; -} - -ACE_INLINE CORBA_Object_ptr & -CORBA_Object_var::out (void) -{ - CORBA::release (this->ptr_); - this->ptr_ = CORBA_Object::_nil (); - return this->ptr_; -} - -ACE_INLINE CORBA_Object_ptr -CORBA_Object_var::_retn (void) -{ - // yield ownership of managed obj reference - CORBA_Object_ptr val = this->ptr_; - this->ptr_ = CORBA_Object::_nil (); - return val; -} - -// ************************************************************* -// Inline operations for class CORBA_Object_out -// ************************************************************* - -ACE_INLINE -CORBA_Object_out::CORBA_Object_out (CORBA_Object_ptr &p) - : ptr_ (p) -{ - this->ptr_ = CORBA_Object::_nil (); -} - -ACE_INLINE -CORBA_Object_out::CORBA_Object_out (CORBA_Object_var &p) // constructor from _var - : ptr_ (p.out ()) -{ - CORBA::release (this->ptr_); - this->ptr_ = CORBA_Object::_nil (); -} - -ACE_INLINE -CORBA_Object_out::CORBA_Object_out (const CORBA_Object_out &p) // copy constructor - : ptr_ (p.ptr_) -{} - -ACE_INLINE CORBA_Object_out & -CORBA_Object_out::operator= (const CORBA_Object_out &p) -{ - this->ptr_ = p.ptr_; - return *this; -} - -ACE_INLINE CORBA_Object_out & -CORBA_Object_out::operator= (const CORBA_Object_var &p) -{ - this->ptr_ = CORBA_Object::_duplicate (p.ptr ()); - return *this; -} - -ACE_INLINE CORBA_Object_out & -CORBA_Object_out::operator= (CORBA_Object_ptr p) -{ - this->ptr_ = p; - return *this; -} - -ACE_INLINE -CORBA_Object_out::operator CORBA_Object_ptr &() // cast -{ - return this->ptr_; -} - -ACE_INLINE CORBA_Object_ptr & -CORBA_Object_out::ptr (void) // ptr -{ - return this->ptr_; -} - -ACE_INLINE CORBA_Object_ptr -CORBA_Object_out::operator-> (void) -{ - return this->ptr_; -} |