diff options
Diffstat (limited to 'cpp/test/Ice/background/Connector.cpp')
-rw-r--r-- | cpp/test/Ice/background/Connector.cpp | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/cpp/test/Ice/background/Connector.cpp b/cpp/test/Ice/background/Connector.cpp new file mode 100644 index 00000000000..9e75d4672c3 --- /dev/null +++ b/cpp/test/Ice/background/Connector.cpp @@ -0,0 +1,69 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2007 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. +// +// ********************************************************************** + +#include <Connector.h> +#include <Transceiver.h> +#include <EndpointI.h> + +using namespace std; + +IceInternal::TransceiverPtr +Connector::connect(int timeout) +{ + _configuration->checkConnectException(); + return new Transceiver(_connector->connect(timeout)); +} + +Ice::Short +Connector::type() const +{ + return (Ice::Short)(EndpointI::TYPE_BASE + _connector->type()); +} + +string +Connector::toString() const +{ + return _connector->toString(); +} + +bool +Connector::operator==(const IceInternal::Connector& r) const +{ + const Connector* p = dynamic_cast<const Connector*>(&r); + if(!p) + { + return false; + } + + return *_connector == *p->_connector; +} + +bool +Connector::operator!=(const IceInternal::Connector& r) const +{ + return !operator==(r); +} + +bool +Connector::operator<(const IceInternal::Connector& r) const +{ + const Connector* p = dynamic_cast<const Connector*>(&r); + if(!p) + { + return type() < r.type(); + } + + return *_connector < *p->_connector; +} + +Connector::Connector(const IceInternal::ConnectorPtr& connector) : + _connector(connector), + _configuration(Configuration::getInstance()) +{ +} |