Use a variable on the stack to not have a temporary in the call
[ACE_TAO.git] / ACE / protocols / ace / INet / ClientRequestHandler.cpp
blob8b17d981330a7127a2ac1aca6cd309f678fbb9b2
1 #include "ace/INet/ClientRequestHandler.h"
2 #include "ace/Functor_String.h"
4 #if !defined (__ACE_INLINE__)
5 #include "ace/INet/ClientRequestHandler.inl"
6 #endif
9 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
11 namespace ACE
13 namespace INet
15 ClientRequestHandler::ClientRequestHandler () {}
17 ClientRequestHandler::~ClientRequestHandler () {}
19 ConnectionCache& ClientRequestHandler::connection_cache ()
21 return *TConnectionCacheSingleton::instance ();
24 ClientINetRequestHandler::ClientINetRequestHandler () {}
26 ClientINetRequestHandler::~ClientINetRequestHandler () {}
28 ClientINetRequestHandler::INetConnectionKey::INetConnectionKey (
29 const ACE_CString& host,
30 u_short port)
31 : ConnectionKey (),
32 host_ (host),
33 port_ (port)
37 ClientINetRequestHandler::INetConnectionKey::~INetConnectionKey ()
40 u_long ClientINetRequestHandler::INetConnectionKey::hash () const
42 return ACE_Hash<ACE_CString>()(this->host_) + this->port_;
45 ConnectionKey* ClientINetRequestHandler::INetConnectionKey::duplicate () const
47 ConnectionKey* k = 0;
48 ACE_NEW_RETURN (k,
49 INetConnectionKey (this->host_, this->port_),
50 0);
51 return k;
54 bool ClientINetRequestHandler::INetConnectionKey::equal (const ConnectionKey& key) const
56 try {
57 const INetConnectionKey& ikey = dynamic_cast<const INetConnectionKey&> (key);
58 return this->host_ == ikey.host_ && this->port_ == ikey.port_;
60 catch (...) {
61 return false;
68 ACE_END_VERSIONED_NAMESPACE_DECL