00001 // -*- C++ -*- 00002 // 00003 // $Id: ORB_Table.inl 73524 2006-07-14 21:39:17Z ossama $ 00004 00005 #include "tao/ORB_Core.h" 00006 00007 #include <algorithm> 00008 00009 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00010 00011 ACE_INLINE ::TAO_ORB_Core * 00012 TAO::ORB_Table::first_orb (void) 00013 { 00014 return this->first_orb_; 00015 } 00016 00017 ACE_INLINE TAO::ORB_Table::iterator 00018 TAO::ORB_Table::begin (void) 00019 { 00020 return this->table_.begin (); 00021 } 00022 00023 ACE_INLINE TAO::ORB_Table::iterator 00024 TAO::ORB_Table::end (void) 00025 { 00026 return this->table_.end (); 00027 } 00028 00029 ACE_INLINE ::TAO_ORB_Core* const * 00030 TAO::ORB_Table::get_orbs (size_t& num_orbs) 00031 { 00032 num_orbs = this->num_orbs_; 00033 return this->orbs_; 00034 } 00035 00036 /// Accessor to the underlying table_ 00037 ACE_INLINE TAO::ORB_Table::Table * 00038 TAO::ORB_Table::table (void) 00039 { 00040 return &this->table_; 00041 } 00042 00043 ACE_INLINE TAO_SYNCH_MUTEX & 00044 TAO::ORB_Table::lock (void) 00045 { 00046 return this->lock_; 00047 } 00048 00049 // **************************************************************** 00050 00051 ACE_INLINE 00052 TAO::ORB_Core_Ref_Counter::ORB_Core_Ref_Counter (void) 00053 : core_ (0) 00054 { 00055 } 00056 00057 ACE_INLINE 00058 TAO::ORB_Core_Ref_Counter::ORB_Core_Ref_Counter (::TAO_ORB_Core * core) 00059 : core_ (core) 00060 { 00061 // ACE_ASSERT (core != 0); 00062 00063 // Note that the TAO_ORB_Core pointer should always be valid in this 00064 // constructor. 00065 00066 // Claim ownership. 00067 (void) this->core_->_incr_refcnt (); 00068 } 00069 00070 ACE_INLINE 00071 TAO::ORB_Core_Ref_Counter::~ORB_Core_Ref_Counter (void) 00072 { 00073 if (this->core_) 00074 (void) this->core_->_decr_refcnt (); // Should never throw. 00075 } 00076 00077 ACE_INLINE 00078 TAO::ORB_Core_Ref_Counter::ORB_Core_Ref_Counter ( 00079 TAO::ORB_Core_Ref_Counter const & rhs) 00080 : core_ (rhs.core_) 00081 { 00082 // Claim ownership. 00083 if (this->core_) 00084 (void) this->core_->_incr_refcnt (); 00085 } 00086 00087 ACE_INLINE void 00088 TAO::ORB_Core_Ref_Counter::operator= (TAO::ORB_Core_Ref_Counter const & rhs) 00089 { 00090 // Strongly exception safe. May not be strictly necessary, but 00091 // let's do things the right way, regardless. 00092 TAO::ORB_Core_Ref_Counter tmp (rhs); 00093 std::swap (this->core_, tmp.core_); 00094 } 00095 00096 TAO_END_VERSIONED_NAMESPACE_DECL