From a80b3c8cbb203c78b061e99e1a764685af4a93e9 Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Wed, 21 Oct 2009 17:02:37 +0200 Subject: - Removed old IceSSL::ConnectionInfo struct, it's now replaced with IceSSL::NativeConnectionInfo. - Removed Ice::ConnectionInfo endpoint attribute. - Added Ice::Connection::getEndpoint() method. - Added Ice::ConnectionInfo adapterName and incoming attributes. - Replaced Tcp and Udp prefixes with TCP and UDP in endpoint/info classes. - Added IPEndpointInfo and IPConnectionInfo intermediate classes. - Fixed 2058: deprecate ice_hash for Ice.Object & Ice.LocalObject, added ice_getHash - Fixed bug where Ice::Endpoint comparison would only compare the endpoint object addresses rather than the endpoint attributes like in Java and C#. - Added ice_getHash implementation for endpoints and cleaned up Reference::hash to use HashUtil.h helper methods. - Added test/Ice/info and removed endpoint info test from test/Ice/proxy. --- cpp/src/IceSSL/EndpointI.cpp | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) (limited to 'cpp/src/IceSSL/EndpointI.cpp') diff --git a/cpp/src/IceSSL/EndpointI.cpp b/cpp/src/IceSSL/EndpointI.cpp index c21db89353c..78c76c10b79 100644 --- a/cpp/src/IceSSL/EndpointI.cpp +++ b/cpp/src/IceSSL/EndpointI.cpp @@ -16,6 +16,7 @@ #include #include #include +#include using namespace std; using namespace Ice; @@ -229,12 +230,12 @@ IceSSL::EndpointI::toString() const Ice::EndpointInfoPtr IceSSL::EndpointI::getInfo() const { - class InfoI : public IceSSL::SSLEndpointInfo + class InfoI : public IceSSL::EndpointInfo { public: InfoI(Ice::Int to, bool comp, const string& host, Ice::Int port) : - SSLEndpointInfo(to, comp, host, port) + EndpointInfo(to, comp, host, port) { } @@ -387,7 +388,7 @@ IceSSL::EndpointI::equivalent(const IceInternal::EndpointIPtr& endpoint) const } bool -IceSSL::EndpointI::operator==(const IceInternal::EndpointI& r) const +IceSSL::EndpointI::operator==(const Ice::LocalObject& r) const { const EndpointI* p = dynamic_cast(&r); if(!p) @@ -429,18 +430,17 @@ IceSSL::EndpointI::operator==(const IceInternal::EndpointI& r) const } bool -IceSSL::EndpointI::operator!=(const IceInternal::EndpointI& r) const -{ - return !operator==(r); -} - -bool -IceSSL::EndpointI::operator<(const IceInternal::EndpointI& r) const +IceSSL::EndpointI::operator<(const Ice::LocalObject& r) const { const EndpointI* p = dynamic_cast(&r); if(!p) { - return type() < r.type(); + const IceInternal::EndpointI* e = dynamic_cast(&r); + if(!e) + { + return false; + } + return type() < e->type(); } if(this == p) @@ -496,6 +496,18 @@ IceSSL::EndpointI::operator<(const IceInternal::EndpointI& r) const return false; } +Ice::Int +IceSSL::EndpointI::hashInit() const +{ + Ice::Int h = 0; + IceInternal::hashAdd(h, _host); + IceInternal::hashAdd(h, _port); + IceInternal::hashAdd(h, _timeout); + IceInternal::hashAdd(h, _connectionId); + IceInternal::hashAdd(h, _compress); + return h; +} + vector IceSSL::EndpointI::connectors(const vector& addresses) const { -- cgit v1.2.3