00001 // -*- C++ -*- 00002 // 00003 // $Id: ConnectionCache.inl 90925 2010-06-29 10:50:40Z mcorino $ 00004 00005 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00006 00007 namespace ACE 00008 { 00009 namespace INet 00010 { 00011 00012 ACE_INLINE 00013 bool ConnectionKey::operator ==(const ConnectionKey& key) const 00014 { 00015 return this->equal (key); 00016 } 00017 00018 ACE_INLINE 00019 bool ConnectionKey::operator !=(const ConnectionKey& key) const 00020 { 00021 return !this->equal (key); 00022 } 00023 00024 ACE_INLINE 00025 bool ConnectionCacheKey::operator ==(const ConnectionCacheKey& cachekey) const 00026 { 00027 return this->key_ ? (this->key () == cachekey.key ()) : !cachekey.key_; 00028 } 00029 00030 ACE_INLINE 00031 bool ConnectionCacheKey::operator !=(const ConnectionCacheKey& cachekey) const 00032 { 00033 return !(*this == cachekey); 00034 } 00035 00036 ACE_INLINE 00037 const ConnectionKey& ConnectionCacheKey::key () const 00038 { 00039 return *this->key_; 00040 } 00041 00042 ACE_INLINE 00043 bool ConnectionCacheValue::operator == (const ConnectionCacheValue& cacheval) const 00044 { 00045 return this->connection () == cacheval.connection () && 00046 this->state () == cacheval.state (); 00047 } 00048 00049 ACE_INLINE 00050 bool ConnectionCacheValue::operator != (const ConnectionCacheValue& cacheval) const 00051 { 00052 return !((*this) == cacheval); 00053 } 00054 00055 ACE_INLINE 00056 ConnectionCacheValue::connection_type* ConnectionCacheValue::connection () 00057 { 00058 return this->connection_; 00059 } 00060 00061 ACE_INLINE 00062 const ConnectionCacheValue::connection_type* ConnectionCacheValue::connection () const 00063 { 00064 return this->connection_; 00065 } 00066 00067 ACE_INLINE 00068 void ConnectionCacheValue::connection (connection_type* conn) 00069 { 00070 this->connection_ = conn; 00071 } 00072 00073 ACE_INLINE 00074 ConnectionCacheValue::State ConnectionCacheValue::state () const 00075 { 00076 return this->state_; 00077 } 00078 00079 ACE_INLINE 00080 void ConnectionCacheValue::state (State st) 00081 { 00082 this->state_ = st; 00083 } 00084 00085 ACE_INLINE 00086 size_t ConnectionCache::current_size () const 00087 { 00088 ACE_MT (ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, 00089 guard_, 00090 this->lock_, 00091 false)); 00092 return this->cache_map_.current_size (); 00093 } 00094 00095 } 00096 } 00097 00098 ACE_END_VERSIONED_NAMESPACE_DECL