diff options
author | Benoit Foucher <benoit@zeroc.com> | 2017-04-27 13:05:25 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2017-04-27 13:05:25 +0200 |
commit | c5ee6fd5310199110dae6b2d01decbd20174d8db (patch) | |
tree | daf558482821eb3a1ffd496b06ba8bcc2edce841 /cpp/src/Ice/EndpointFactory.h | |
parent | Extra whitespace (diff) | |
download | ice-c5ee6fd5310199110dae6b2d01decbd20174d8db.tar.bz2 ice-c5ee6fd5310199110dae6b2d01decbd20174d8db.tar.xz ice-c5ee6fd5310199110dae6b2d01decbd20174d8db.zip |
Fixed ICE-6680 - WS transports are now provided by a separate IceWS plugin
Diffstat (limited to 'cpp/src/Ice/EndpointFactory.h')
-rw-r--r-- | cpp/src/Ice/EndpointFactory.h | 67 |
1 files changed, 64 insertions, 3 deletions
diff --git a/cpp/src/Ice/EndpointFactory.h b/cpp/src/Ice/EndpointFactory.h index 1a206b52d6b..b775cd1c91a 100644 --- a/cpp/src/Ice/EndpointFactory.h +++ b/cpp/src/Ice/EndpointFactory.h @@ -33,19 +33,80 @@ public: virtual ~EndpointFactory(); - virtual ::Ice::Short type() const = 0; - virtual ::std::string protocol() const = 0; + virtual void initialize(); + virtual Ice::Short type() const = 0; + virtual std::string protocol() const = 0; virtual EndpointIPtr create(std::vector<std::string>&, bool) const = 0; virtual EndpointIPtr read(Ice::InputStream*) const = 0; virtual void destroy() = 0; - virtual EndpointFactoryPtr clone(const ProtocolInstancePtr&, const EndpointFactoryPtr&) const = 0; + virtual EndpointFactoryPtr clone(const ProtocolInstancePtr&) const = 0; protected: EndpointFactory(); }; +// +// The endpoint factory with underlying create endpoints that delegate to an underlying +// endpoint (e.g.: the SSL/WS endpoints are endpoints with underlying endpoints). +// +class ICE_API EndpointFactoryWithUnderlying : public EndpointFactory +{ +public: + + EndpointFactoryWithUnderlying(const ProtocolInstancePtr&, Ice::Short); + + virtual void initialize(); + virtual Ice::Short type() const; + virtual std::string protocol() const; + virtual EndpointIPtr create(std::vector<std::string>&, bool) const; + virtual EndpointIPtr read(Ice::InputStream*) const; + virtual void destroy(); + + virtual EndpointFactoryPtr clone(const ProtocolInstancePtr&) const; + + virtual EndpointFactoryPtr cloneWithUnderlying(const ProtocolInstancePtr&, Ice::Short) const = 0; + +protected: + + virtual EndpointIPtr createWithUnderlying(const EndpointIPtr&, std::vector<std::string>&, bool) const = 0; + virtual EndpointIPtr readWithUnderlying(const EndpointIPtr&, Ice::InputStream*) const = 0; + + ProtocolInstancePtr _instance; + const Ice::Short _type; + EndpointFactoryPtr _underlying; +}; + +// +// The underlying endpoint factory creates endpoints with a factory of the given +// type. If this factory is of the EndpointFactoryWithUnderlying type, it will +// delegate to the given underlying factory (this is used by IceIAP/IceBT plugins +// for the BTS/iAPS endpoint factories). +// +class ICE_API UnderlyingEndpointFactory : public EndpointFactory +{ +public: + + UnderlyingEndpointFactory(const ProtocolInstancePtr&, Ice::Short, Ice::Short); + + virtual void initialize(); + virtual Ice::Short type() const; + virtual std::string protocol() const; + virtual EndpointIPtr create(std::vector<std::string>&, bool) const; + virtual EndpointIPtr read(Ice::InputStream*) const; + virtual void destroy(); + + virtual EndpointFactoryPtr clone(const ProtocolInstancePtr&) const; + +private: + + ProtocolInstancePtr _instance; + const Ice::Short _type; + const Ice::Short _underlying; + EndpointFactoryPtr _factory; +}; + class ICE_API EndpointFactoryPlugin : public Ice::Plugin { public: |