Merge pull request #2254 from esohns/fstat_size_64_bits
[ACE_TAO.git] / ACE / protocols / ace / INet / ConnectionCache.inl
blob73d66d2ce42ce294c6975ccc7adb4db356c4f5f7
1 // -*- C++ -*-
2 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
4 namespace ACE
6   namespace INet
7   {
9     ACE_INLINE
10     bool ConnectionKey::operator ==(const ConnectionKey& key) const
11       {
12         return this->equal (key);
13       }
15     ACE_INLINE
16     bool ConnectionKey::operator !=(const ConnectionKey& key) const
17       {
18         return !this->equal (key);
19       }
21     ACE_INLINE
22     bool ConnectionCacheKey::operator ==(const ConnectionCacheKey& cachekey) const
23       {
24         return this->key_ ? (this->key () == cachekey.key ()) : !cachekey.key_;
25       }
27     ACE_INLINE
28     bool ConnectionCacheKey::operator !=(const ConnectionCacheKey& cachekey) const
29       {
30         return !(*this == cachekey);
31       }
33     ACE_INLINE
34     const ConnectionKey& ConnectionCacheKey::key () const
35       {
36         return *this->key_;
37       }
39     ACE_INLINE
40     bool ConnectionCacheValue::operator == (const ConnectionCacheValue& cacheval) const
41       {
42         return this->connection () == cacheval.connection () &&
43                 this->state () == cacheval.state ();
44       }
46     ACE_INLINE
47     bool ConnectionCacheValue::operator != (const ConnectionCacheValue& cacheval) const
48       {
49         return !((*this) == cacheval);
50       }
52     ACE_INLINE
53     ConnectionCacheValue::connection_type* ConnectionCacheValue::connection ()
54       {
55         return this->connection_;
56       }
58     ACE_INLINE
59     const ConnectionCacheValue::connection_type* ConnectionCacheValue::connection () const
60       {
61         return this->connection_;
62       }
64     ACE_INLINE
65     void ConnectionCacheValue::connection (connection_type* conn)
66       {
67         this->connection_ = conn;
68       }
70     ACE_INLINE
71     ConnectionCacheValue::State ConnectionCacheValue::state () const
72       {
73         return this->state_;
74       }
76     ACE_INLINE
77     void ConnectionCacheValue::state (State st)
78       {
79         this->state_ = st;
80       }
82     ACE_INLINE
83     size_t ConnectionCache::current_size () const
84       {
85         ACE_MT (ACE_GUARD_RETURN (ACE_SYNCH_MUTEX,
86                                   guard_,
87                                   this->lock_,
88                                   false));
89         return this->cache_map_.current_size ();
90       }
92   }
95 ACE_END_VERSIONED_NAMESPACE_DECL