00001 // -*- C++ -*- 00002 // 00003 // $Id: ORB.inl 83911 2008-11-28 14:34:11Z johnnyw $ 00004 00005 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00006 00007 // --------------------------------------------------------------------------- 00008 // ORB specific 00009 // --------------------------------------------------------------------------- 00010 00011 ACE_INLINE ACE_Time_Value * 00012 CORBA::ORB::get_timeout (void) 00013 { 00014 return this->timeout_; 00015 } 00016 00017 ACE_INLINE void 00018 CORBA::ORB::set_timeout (ACE_Time_Value *timeout) 00019 { 00020 this->timeout_ = timeout; 00021 } 00022 00023 ACE_INLINE unsigned long 00024 CORBA::ORB::_incr_refcnt (void) 00025 { 00026 return ++this->refcount_; 00027 } 00028 00029 ACE_INLINE unsigned long 00030 CORBA::ORB::_refcnt (void) const 00031 { 00032 return this->refcount_.value (); 00033 } 00034 00035 ACE_INLINE unsigned long 00036 CORBA::ORB::_decr_refcnt (void) 00037 { 00038 unsigned long const count = --this->refcount_; 00039 00040 if (count != 0) 00041 { 00042 return count; 00043 } 00044 00045 delete this; 00046 return 0; 00047 } 00048 00049 ACE_INLINE CORBA::ORB_ptr 00050 CORBA::ORB::_duplicate (CORBA::ORB_ptr obj) 00051 { 00052 if (obj) 00053 { 00054 obj->_incr_refcnt (); 00055 } 00056 00057 return obj; 00058 } 00059 00060 // Null pointers represent nil objects. 00061 00062 ACE_INLINE CORBA::ORB_ptr 00063 CORBA::ORB::_nil (void) 00064 { 00065 return 0; 00066 } 00067 00068 ACE_INLINE void 00069 CORBA::ORB::_use_omg_ior_format (CORBA::Boolean ior) 00070 { 00071 this->use_omg_ior_format_ = ior; 00072 } 00073 00074 ACE_INLINE CORBA::Boolean 00075 CORBA::ORB::_use_omg_ior_format (void) 00076 { 00077 return this->use_omg_ior_format_; 00078 } 00079 00080 ACE_INLINE TAO_ORB_Core * 00081 CORBA::ORB::orb_core (void) const 00082 { 00083 return this->orb_core_; 00084 } 00085 00086 // ************************************************************ 00087 // These are in CORBA namespace 00088 // ************************************************************ 00089 00090 ACE_INLINE CORBA::Boolean 00091 CORBA::is_nil (CORBA::ORB_ptr obj) 00092 { 00093 return obj == CORBA::ORB::_nil (); 00094 } 00095 00096 ACE_INLINE void 00097 CORBA::release (CORBA::ORB_ptr obj) 00098 { 00099 if (!CORBA::is_nil (obj)) 00100 obj->_decr_refcnt (); 00101 } 00102 00103 TAO_END_VERSIONED_NAMESPACE_DECL