diff options
author | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-04-26 03:35:17 +0000 |
---|---|---|
committer | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-04-26 03:35:17 +0000 |
commit | 0684b34d0ee127331e13be5ae08442e936500586 (patch) | |
tree | 7e010e59c86149d410be0abf214c842a8d704af0 /TAO/tao/Object.i | |
parent | 48647abd35a92ff4cc39168a997f83263be511a3 (diff) | |
download | ATCD-0684b34d0ee127331e13be5ae08442e936500586.tar.gz |
ChangeLogTag:Tue Apr 25 19:25:28 2000 Nanbor Wang <nanbor@cs.wustl.edu>
Diffstat (limited to 'TAO/tao/Object.i')
-rw-r--r-- | TAO/tao/Object.i | 46 |
1 files changed, 34 insertions, 12 deletions
diff --git a/TAO/tao/Object.i b/TAO/tao/Object.i index 232315bddfc..dd1f0351da5 100644 --- a/TAO/tao/Object.i +++ b/TAO/tao/Object.i @@ -2,6 +2,17 @@ // **************************************************************** +ACE_INLINE +CORBA_Object::CORBA_Object (int) + : servant_ (0), + is_collocated_ (0), + is_local_ (1), + protocol_proxy_ (0), + refcount_ (1), + refcount_lock_ () +{ +} + ACE_INLINE CORBA::ULong CORBA_Object::_incr_refcnt (void) { @@ -27,10 +38,16 @@ ACE_INLINE CORBA_Object_ptr CORBA_Object::_duplicate (CORBA_Object_ptr obj) { if (obj) - obj->_incr_refcnt (); + obj->_add_ref (); return obj; } +ACE_INLINE CORBA::Boolean +CORBA::is_nil (CORBA::Object_ptr obj) +{ + return obj == 0; +} + // Null pointers represent nil objects. ACE_INLINE CORBA_Object_ptr @@ -40,15 +57,25 @@ CORBA_Object::_nil (void) } ACE_INLINE CORBA_Object_ptr -CORBA_Object::_narrow (CORBA_Object_ptr obj, CORBA::Environment&) +CORBA_Object::_unchecked_narrow (CORBA_Object_ptr obj, CORBA::Environment&) { - return CORBA_Object::_duplicate (obj); + if (CORBA::is_nil (obj)) + return CORBA::Object::_nil (); + + if (obj->is_local_) + return + ACE_reinterpret_cast (CORBA::Object_ptr, + obj->_tao_QueryInterface + (ACE_reinterpret_cast (ptr_arith_t, + &CORBA::Object::_narrow))); + else + return CORBA::Object::_duplicate (obj); } ACE_INLINE CORBA_Object_ptr -CORBA_Object::_unchecked_narrow (CORBA_Object_ptr obj, CORBA::Environment&) +CORBA_Object::_narrow (CORBA_Object_ptr obj, CORBA::Environment&ACE_TRY_ENV) { - return CORBA_Object::_duplicate (obj); + return CORBA_Object::_unchecked_narrow (obj, ACE_TRY_ENV); } ACE_INLINE TAO_Stub * @@ -57,20 +84,15 @@ 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 (); + obj->_remove_ref (); } // DII hook to objref |