diff options
author | Mark Spruiell <mes@zeroc.com> | 2014-03-19 12:45:55 -0700 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2014-03-19 12:45:55 -0700 |
commit | cdcffbcc3c3c052afdeb772ff0167e7a90b525bb (patch) | |
tree | 4f16ee41ef7d33394c44e9db81e4d6cd89908250 /cpp/src/Ice/EndpointI.h | |
parent | fixing testicedist.py for 5487 (diff) | |
download | ice-cdcffbcc3c3c052afdeb772ff0167e7a90b525bb.tar.bz2 ice-cdcffbcc3c3c052afdeb772ff0167e7a90b525bb.tar.xz ice-cdcffbcc3c3c052afdeb772ff0167e7a90b525bb.zip |
merging javascript branch
Diffstat (limited to 'cpp/src/Ice/EndpointI.h')
-rw-r--r-- | cpp/src/Ice/EndpointI.h | 93 |
1 files changed, 18 insertions, 75 deletions
diff --git a/cpp/src/Ice/EndpointI.h b/cpp/src/Ice/EndpointI.h index 3e14f4d30b9..08e0d4fe6a4 100644 --- a/cpp/src/Ice/EndpointI.h +++ b/cpp/src/Ice/EndpointI.h @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. @@ -10,24 +10,12 @@ #ifndef ICE_ENDPOINT_I_H #define ICE_ENDPOINT_I_H -#include <IceUtil/Config.h> -#include <IceUtil/Shared.h> -#include <IceUtil/Thread.h> -#include <IceUtil/Monitor.h> +#include <Ice/EndpointIF.h> #include <Ice/Endpoint.h> #include <Ice/EndpointTypes.h> -#include <Ice/EndpointIF.h> -#include <Ice/InstanceF.h> #include <Ice/TransceiverF.h> #include <Ice/ConnectorF.h> #include <Ice/AcceptorF.h> -#include <Ice/Protocol.h> -#include <Ice/Network.h> -#include <Ice/ObserverHelper.h> - -#ifndef ICE_OS_WINRT -# include <deque> -#endif namespace IceInternal { @@ -43,7 +31,6 @@ public: virtual void connectors(const std::vector<ConnectorPtr>&) = 0; virtual void exception(const Ice::LocalException&) = 0; }; -typedef IceUtil::Handle<EndpointI_connectors> EndpointI_connectorsPtr; class ICE_API EndpointI : public Ice::Endpoint { @@ -62,8 +49,8 @@ public: // // Return the protocol name // - virtual std::string protocol() const = 0; - + virtual const std::string& protocol() const = 0; + // // Return the timeout for the endpoint in milliseconds. 0 means // non-blocking, -1 means no timeout. @@ -78,6 +65,11 @@ public: virtual EndpointIPtr timeout(Ice::Int) const = 0; // + // Returns the endpoint connection id. + // + virtual const std::string& connectionId() const = 0; + + // // Return a new endpoint with a different connection id. // virtual EndpointIPtr connectionId(const ::std::string&) const = 0; @@ -142,8 +134,6 @@ public: // Check whether the endpoint is equivalent to another one. // virtual bool equivalent(const EndpointIPtr&) const = 0; - - virtual std::vector<ConnectorPtr> connectors(const std::vector<Address>&, const NetworkProxyPtr&) const; // // Compare endpoints for sorting purposes. @@ -151,25 +141,20 @@ public: virtual bool operator==(const Ice::LocalObject&) const = 0; virtual bool operator<(const Ice::LocalObject&) const = 0; - const std::string& connectionId() const; - -protected: - - virtual ::Ice::Int internal_getHash() const; - - friend class EndpointHostResolver; + virtual ::Ice::Int hash() const = 0; - EndpointI(const std::string&); - EndpointI(); + // + // Returns the stringified options + // + virtual std::string options() const = 0; - virtual ::Ice::Int hashInit() const = 0; + virtual std::string toString() const; + void initWithOptions(std::vector<std::string>&); - const std::string _connectionId; +protected: -private: + virtual bool checkOption(const std::string&, const std::string&, const std::string&); - mutable bool _hashInitialized; - mutable Ice::Int _hashValue; }; inline bool operator==(const EndpointI& l, const EndpointI& r) @@ -182,48 +167,6 @@ inline bool operator<(const EndpointI& l, const EndpointI& r) return static_cast<const ::Ice::LocalObject&>(l) < static_cast<const ::Ice::LocalObject&>(r); } -#ifndef ICE_OS_WINRT -class ICE_API EndpointHostResolver : public IceUtil::Thread, public IceUtil::Monitor<IceUtil::Mutex> -#else -class ICE_API EndpointHostResolver : public IceUtil::Shared -#endif -{ -public: - - EndpointHostResolver(const InstancePtr&); - - std::vector<ConnectorPtr> resolve(const std::string&, int, Ice::EndpointSelectionType, const EndpointIPtr&); - void resolve(const std::string&, int, Ice::EndpointSelectionType, const EndpointIPtr&, - const EndpointI_connectorsPtr&); - void destroy(); - - virtual void run(); - void updateObserver(); - -private: - -#ifndef ICE_OS_WINRT - struct ResolveEntry - { - std::string host; - int port; - Ice::EndpointSelectionType selType; - EndpointIPtr endpoint; - EndpointI_connectorsPtr callback; - Ice::Instrumentation::ObserverPtr observer; - }; - - const InstancePtr _instance; - const IceInternal::ProtocolSupport _protocol; - const bool _preferIPv6; - bool _destroyed; - std::deque<ResolveEntry> _queue; - ObserverHelperT<Ice::Instrumentation::ThreadObserver> _observer; -#else - const InstancePtr _instance; -#endif -}; - } #endif |