summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/EndpointFactory.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2002-04-26 02:53:33 +0000
committerMark Spruiell <mes@zeroc.com>2002-04-26 02:53:33 +0000
commit0d715a1edd4484c9b7074c9c3cb283d468a538bc (patch)
tree45934688c11aa189731ae51f07032050affd12ef /cpp/src/Ice/EndpointFactory.cpp
parentWin32 fix (diff)
downloadice-0d715a1edd4484c9b7074c9c3cb283d468a538bc.tar.bz2
ice-0d715a1edd4484c9b7074c9c3cb283d468a538bc.tar.xz
ice-0d715a1edd4484c9b7074c9c3cb283d468a538bc.zip
Renaming Ice.Trace.Security to IceSSL.Trace.Security Cleaning up IceSSL
dependencies on Ice core
Diffstat (limited to 'cpp/src/Ice/EndpointFactory.cpp')
-rw-r--r--cpp/src/Ice/EndpointFactory.cpp121
1 files changed, 0 insertions, 121 deletions
diff --git a/cpp/src/Ice/EndpointFactory.cpp b/cpp/src/Ice/EndpointFactory.cpp
index 364d0f13142..fdc63fedb32 100644
--- a/cpp/src/Ice/EndpointFactory.cpp
+++ b/cpp/src/Ice/EndpointFactory.cpp
@@ -9,12 +9,6 @@
// **********************************************************************
#include <Ice/EndpointFactory.h>
-#include <Ice/Endpoint.h>
-#include <Ice/UnknownEndpoint.h>
-#include <Ice/Network.h>
-#include <Ice/BasicStream.h>
-#include <Ice/LocalException.h>
-#include <Ice/Instance.h>
using namespace std;
using namespace Ice;
@@ -22,8 +16,6 @@ using namespace IceInternal;
void IceInternal::incRef(EndpointFactory* p) { p->__incRef(); }
void IceInternal::decRef(EndpointFactory* p) { p->__decRef(); }
-void IceInternal::incRef(EndpointFactoryManager* p) { p->__incRef(); }
-void IceInternal::decRef(EndpointFactoryManager* p) { p->__decRef(); }
IceInternal::EndpointFactory::EndpointFactory()
{
@@ -32,116 +24,3 @@ IceInternal::EndpointFactory::EndpointFactory()
IceInternal::EndpointFactory::~EndpointFactory()
{
}
-
-IceInternal::EndpointFactoryManager::EndpointFactoryManager(const InstancePtr& instance)
- : _instance(instance)
-{
-}
-
-void
-IceInternal::EndpointFactoryManager::add(const EndpointFactoryPtr& factory)
-{
- IceUtil::Mutex::Lock sync(*this); // TODO: Necessary?
-
- //
- // TODO: Optimize with a map?
- //
- for (vector<EndpointFactoryPtr>::size_type i = 0; i < _factories.size(); i++)
- {
- if (_factories[i]->type() == factory->type())
- {
- assert(false); // TODO: Exception?
- }
- }
- _factories.push_back(factory);
-}
-
-EndpointFactoryPtr
-IceInternal::EndpointFactoryManager::get(Short type) const
-{
- IceUtil::Mutex::Lock sync(*this); // TODO: Necessary?
-
- //
- // TODO: Optimize with a map?
- //
- for (vector<EndpointFactoryPtr>::size_type i = 0; i < _factories.size(); i++)
- {
- if (_factories[i]->type() == type)
- {
- return _factories[i];
- }
- }
- return 0;
-}
-
-EndpointPtr
-IceInternal::EndpointFactoryManager::create(const string& str) const
-{
- IceUtil::Mutex::Lock sync(*this); // TODO: Necessary?
-
- static const string delim = " \t\n\r";
-
- string::size_type beg = str.find_first_not_of(delim);
- if (beg == string::npos)
- {
- throw EndpointParseException(__FILE__, __LINE__);
- }
-
- string::size_type end = str.find_first_of(delim, beg);
- if (end == string::npos)
- {
- end = str.length();
- }
-
- string protocol = str.substr(beg, end - beg);
-
- if (protocol == "default")
- {
- protocol = _instance->defaultProtocol();
- }
-
- //
- // TODO: Optimize with a map?
- //
- for (vector<EndpointFactoryPtr>::size_type i = 0; i < _factories.size(); i++)
- {
- if (_factories[i]->protocol() == protocol)
- {
- return _factories[i]->create(str.substr(end));
- }
- }
-
- throw EndpointParseException(__FILE__, __LINE__);
-}
-
-EndpointPtr
-IceInternal::EndpointFactoryManager::read(BasicStream* s) const
-{
- IceUtil::Mutex::Lock sync(*this); // TODO: Necessary?
-
- Short type;
- s->read(type);
-
- //
- // TODO: Optimize with a map?
- //
- for (vector<EndpointFactoryPtr>::size_type i = 0; i < _factories.size(); i++)
- {
- if (_factories[i]->type() == type)
- {
- return _factories[i]->read(s);
- }
- }
-
- return new UnknownEndpoint(type, s);
-}
-
-void
-IceInternal::EndpointFactoryManager::destroy()
-{
- for (vector<EndpointFactoryPtr>::size_type i = 0; i < _factories.size(); i++)
- {
- _factories[i]->destroy();
- }
- _factories.clear();
-}