00001 // -*- C++ -*- 00002 // 00003 // ORB_Table.inl,v 1.12 2006/02/22 05:03:49 frehberger Exp 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 // **************************************************************** 00044 00045 ACE_INLINE 00046 TAO::ORB_Core_Ref_Counter::ORB_Core_Ref_Counter (void) 00047 : core_ (0) 00048 { 00049 } 00050 00051 ACE_INLINE 00052 TAO::ORB_Core_Ref_Counter::ORB_Core_Ref_Counter (::TAO_ORB_Core * core) 00053 : core_ (core) 00054 { 00055 // ACE_ASSERT (core != 0); 00056 00057 // Note that the TAO_ORB_Core pointer should always be valid in this 00058 // constructor. 00059 00060 // Claim ownership. 00061 (void) this->core_->_incr_refcnt (); 00062 } 00063 00064 ACE_INLINE 00065 TAO::ORB_Core_Ref_Counter::~ORB_Core_Ref_Counter (void) 00066 { 00067 if (this->core_) 00068 (void) this->core_->_decr_refcnt (); // Should never throw. 00069 } 00070 00071 ACE_INLINE 00072 TAO::ORB_Core_Ref_Counter::ORB_Core_Ref_Counter ( 00073 TAO::ORB_Core_Ref_Counter const & rhs) 00074 : core_ (rhs.core_) 00075 { 00076 // Claim ownership. 00077 if (this->core_) 00078 (void) this->core_->_incr_refcnt (); 00079 } 00080 00081 ACE_INLINE void 00082 TAO::ORB_Core_Ref_Counter::operator= (TAO::ORB_Core_Ref_Counter const & rhs) 00083 { 00084 // Strongly exception safe. May not be strictly necessary, but 00085 // let's do things the right way, regardless. 00086 TAO::ORB_Core_Ref_Counter tmp (rhs); 00087 std::swap (this->core_, tmp.core_); 00088 } 00089 00090 TAO_END_VERSIONED_NAMESPACE_DECL