00001 // -*- C++ -*- 00002 // 00003 // ORB.i,v 1.46 2006/04/19 08:46:27 jwillemsen Exp 00004 00005 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00006 00007 // --------------------------------------------------------------------------- 00008 // ORB specific 00009 // --------------------------------------------------------------------------- 00010 00011 ACE_INLINE CORBA::ULong 00012 CORBA::ORB::_incr_refcnt (void) 00013 { 00014 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, 00015 guard, 00016 lock_, 00017 0); 00018 return ++this->refcount_; 00019 } 00020 00021 ACE_INLINE CORBA::ULong 00022 CORBA::ORB::_decr_refcnt (void) 00023 { 00024 { 00025 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, this->lock_, 0); 00026 --this->refcount_; 00027 00028 if (this->refcount_ != 0) 00029 { 00030 return this->refcount_; 00031 } 00032 } 00033 00034 delete this; 00035 return 0; 00036 } 00037 00038 ACE_INLINE CORBA::ORB_ptr 00039 CORBA::ORB::_duplicate (CORBA::ORB_ptr obj) 00040 { 00041 if (obj) 00042 { 00043 obj->_incr_refcnt (); 00044 } 00045 00046 return obj; 00047 } 00048 00049 // Null pointers represent nil objects. 00050 00051 ACE_INLINE CORBA::ORB_ptr 00052 CORBA::ORB::_nil (void) 00053 { 00054 return 0; 00055 } 00056 00057 ACE_INLINE void 00058 CORBA::ORB::_use_omg_ior_format (CORBA::Boolean ior) 00059 { 00060 this->use_omg_ior_format_ = ior; 00061 } 00062 00063 ACE_INLINE CORBA::Boolean 00064 CORBA::ORB::_use_omg_ior_format (void) 00065 { 00066 return this->use_omg_ior_format_; 00067 } 00068 00069 ACE_INLINE TAO_ORB_Core * 00070 CORBA::ORB::orb_core (void) const 00071 { 00072 return this->orb_core_; 00073 } 00074 00075 // ************************************************************ 00076 // These are in CORBA namespace 00077 // ************************************************************ 00078 00079 ACE_INLINE CORBA::Boolean 00080 CORBA::is_nil (CORBA::ORB_ptr obj) 00081 { 00082 return obj == CORBA::ORB::_nil (); 00083 } 00084 00085 ACE_INLINE void 00086 CORBA::release (CORBA::ORB_ptr obj) 00087 { 00088 if (!CORBA::is_nil (obj)) 00089 obj->_decr_refcnt (); 00090 } 00091 00092 TAO_END_VERSIONED_NAMESPACE_DECL