summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rw-r--r--cpp/demo/IcePack/hello/.depend7
-rw-r--r--cpp/demo/IcePack/hello/HelloI.h57
-rw-r--r--cpp/demo/IcePack/hello/HelloServiceI.h44
-rw-r--r--cpp/src/IcePack/ObjectRegistryI.cpp185
-rw-r--r--cpp/src/IcePack/ObjectRegistryI.h52
5 files changed, 345 insertions, 0 deletions
diff --git a/cpp/demo/IcePack/hello/.depend b/cpp/demo/IcePack/hello/.depend
new file mode 100644
index 00000000000..b6de7c12811
--- /dev/null
+++ b/cpp/demo/IcePack/hello/.depend
@@ -0,0 +1,7 @@
+Hello.o: Hello.cpp Hello.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/IceUtil/Config.h ../../../include/Ice/Config.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/IceUtil/Shared.h ../../../include/Ice/StreamF.h ../../../include/Ice/Proxy.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/Lock.h ../../../include/IceUtil/ThreadException.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/EndpointF.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/OutgoingAsyncF.h ../../../include/Ice/Current.h ../../../include/Ice/Identity.h ../../../include/Ice/Facet.h ../../../include/Ice/Object.h ../../../include/Ice/Outgoing.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/Ice/BasicStream.h ../../../include/Ice/InstanceF.h ../../../include/Ice/Buffer.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/Incoming.h ../../../include/Ice/Direct.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/LocalException.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/Stream.h ../../../include/Ice/BuiltinSequences.h
+Client.o: Client.cpp ../../../include/Ice/Ice.h ../../../include/Ice/Initialize.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/IceUtil/Config.h ../../../include/Ice/Config.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/IceUtil/Shared.h ../../../include/Ice/StreamF.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/InstanceF.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/Proxy.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/Lock.h ../../../include/IceUtil/ThreadException.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/EndpointF.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/OutgoingAsyncF.h ../../../include/Ice/Current.h ../../../include/Ice/Identity.h ../../../include/Ice/Facet.h ../../../include/Ice/Object.h ../../../include/Ice/Outgoing.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/Ice/BasicStream.h ../../../include/Ice/Buffer.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/Incoming.h ../../../include/Ice/Direct.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/LoggerF.h ../../../include/Ice/Communicator.h ../../../include/Ice/UserExceptionFactoryF.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/IdentityUtil.h ../../../include/Ice/Application.h ../../../include/IcePack/Query.h ../../../include/IcePack/Exception.h Hello.h
+HelloI.o: HelloI.cpp ../../../include/Ice/Ice.h ../../../include/Ice/Initialize.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/IceUtil/Config.h ../../../include/Ice/Config.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/IceUtil/Shared.h ../../../include/Ice/StreamF.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/InstanceF.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/Proxy.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/Lock.h ../../../include/IceUtil/ThreadException.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/EndpointF.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/OutgoingAsyncF.h ../../../include/Ice/Current.h ../../../include/Ice/Identity.h ../../../include/Ice/Facet.h ../../../include/Ice/Object.h ../../../include/Ice/Outgoing.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/Ice/BasicStream.h ../../../include/Ice/Buffer.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/Incoming.h ../../../include/Ice/Direct.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/LoggerF.h ../../../include/Ice/Communicator.h ../../../include/Ice/UserExceptionFactoryF.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/IdentityUtil.h ../../../include/Ice/Application.h ../../../include/IcePack/Admin.h ../../../include/IceBox/IceBox.h ../../../include/Freeze/DB.h ../../../include/Freeze/DBException.h ../../../include/Freeze/DBF.h ../../../include/Freeze/EvictorF.h ../../../include/IcePack/Exception.h HelloI.h Hello.h
+HelloServiceI.o: HelloServiceI.cpp ../../../include/Ice/Ice.h ../../../include/Ice/Initialize.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/IceUtil/Config.h ../../../include/Ice/Config.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/IceUtil/Shared.h ../../../include/Ice/StreamF.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/InstanceF.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/Proxy.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/Lock.h ../../../include/IceUtil/ThreadException.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/EndpointF.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/OutgoingAsyncF.h ../../../include/Ice/Current.h ../../../include/Ice/Identity.h ../../../include/Ice/Facet.h ../../../include/Ice/Object.h ../../../include/Ice/Outgoing.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/Ice/BasicStream.h ../../../include/Ice/Buffer.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/Incoming.h ../../../include/Ice/Direct.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/LoggerF.h ../../../include/Ice/Communicator.h ../../../include/Ice/UserExceptionFactoryF.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/IdentityUtil.h ../../../include/Ice/Application.h HelloServiceI.h ../../../include/IceBox/IceBox.h ../../../include/Freeze/DB.h ../../../include/Freeze/DBException.h ../../../include/Freeze/DBF.h ../../../include/Freeze/EvictorF.h HelloI.h Hello.h
+HelloI.o: HelloI.cpp ../../../include/Ice/Ice.h ../../../include/Ice/Initialize.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/IceUtil/Config.h ../../../include/Ice/Config.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/IceUtil/Shared.h ../../../include/Ice/StreamF.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/InstanceF.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/Proxy.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/Lock.h ../../../include/IceUtil/ThreadException.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/EndpointF.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/OutgoingAsyncF.h ../../../include/Ice/Current.h ../../../include/Ice/Identity.h ../../../include/Ice/Facet.h ../../../include/Ice/Object.h ../../../include/Ice/Outgoing.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/Ice/BasicStream.h ../../../include/Ice/Buffer.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/Incoming.h ../../../include/Ice/Direct.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/LoggerF.h ../../../include/Ice/Communicator.h ../../../include/Ice/UserExceptionFactoryF.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/IdentityUtil.h ../../../include/Ice/Application.h ../../../include/IcePack/Admin.h ../../../include/IceBox/IceBox.h ../../../include/Freeze/DB.h ../../../include/Freeze/DBException.h ../../../include/Freeze/DBF.h ../../../include/Freeze/EvictorF.h ../../../include/IcePack/Exception.h HelloI.h Hello.h
+Server.o: Server.cpp ../../../include/Ice/Ice.h ../../../include/Ice/Initialize.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/IceUtil/Config.h ../../../include/Ice/Config.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/IceUtil/Shared.h ../../../include/Ice/StreamF.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/InstanceF.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/Proxy.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/Lock.h ../../../include/IceUtil/ThreadException.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/EndpointF.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/OutgoingAsyncF.h ../../../include/Ice/Current.h ../../../include/Ice/Identity.h ../../../include/Ice/Facet.h ../../../include/Ice/Object.h ../../../include/Ice/Outgoing.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/Ice/BasicStream.h ../../../include/Ice/Buffer.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/Incoming.h ../../../include/Ice/Direct.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/LoggerF.h ../../../include/Ice/Communicator.h ../../../include/Ice/UserExceptionFactoryF.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/IdentityUtil.h ../../../include/Ice/Application.h HelloI.h Hello.h
+Hello.cpp: Hello.ice
diff --git a/cpp/demo/IcePack/hello/HelloI.h b/cpp/demo/IcePack/hello/HelloI.h
new file mode 100644
index 00000000000..d40c7d5df82
--- /dev/null
+++ b/cpp/demo/IcePack/hello/HelloI.h
@@ -0,0 +1,57 @@
+// **********************************************************************
+//
+// Copyright (c) 2002
+// ZeroC, Inc.
+// Billerica, MA, USA
+//
+// All Rights Reserved.
+//
+// Ice is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License version 2 as published by
+// the Free Software Foundation.
+//
+// **********************************************************************
+
+#ifndef HELLO_I_H
+#define HELLO_I_H
+
+#include <Hello.h>
+
+#if defined(_WIN32)
+# define HELLO_API __declspec(dllexport)
+#else
+# define HELLO_API /**/
+#endif
+
+class HELLO_API HelloFactoryI : public HelloFactory, public IceUtil::Mutex
+{
+public:
+
+ HelloFactoryI();
+
+ virtual HelloPrx create(const std::string&, const Ice::Current&);
+
+ virtual HelloPrx find(const std::string&, const Ice::Current&) const;
+
+private:
+
+ std::string _id;
+
+};
+
+class HELLO_API HelloI : public Hello
+{
+public:
+
+ HelloI(const std::string&);
+
+ virtual void sayHello(const Ice::Current&) const;
+
+ virtual void destroy(const Ice::Current&);
+
+private:
+
+ Ice::CommunicatorPtr _communicator;
+};
+
+#endif
diff --git a/cpp/demo/IcePack/hello/HelloServiceI.h b/cpp/demo/IcePack/hello/HelloServiceI.h
new file mode 100644
index 00000000000..971b8b5179a
--- /dev/null
+++ b/cpp/demo/IcePack/hello/HelloServiceI.h
@@ -0,0 +1,44 @@
+// **********************************************************************
+//
+// Copyright (c) 2002
+// ZeroC, Inc.
+// Billerica, MA, USA
+//
+// All Rights Reserved.
+//
+// Ice is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License version 2 as published by
+// the Free Software Foundation.
+//
+// **********************************************************************
+
+#ifndef HELLO_SERVICE_I_H
+#define HELLO_SERVICE_I_H
+
+#include <IceBox/IceBox.h>
+
+#if defined(_WIN32)
+# define HELLO_API __declspec(dllexport)
+#else
+# define HELLO_API /**/
+#endif
+
+class HELLO_API HelloServiceI : public ::IceBox::Service
+{
+public:
+
+ HelloServiceI();
+ virtual ~HelloServiceI();
+
+ virtual void start(const ::std::string&,
+ const ::Ice::CommunicatorPtr&,
+ const ::Ice::StringSeq&);
+
+ virtual void stop();
+
+private:
+
+ ::Ice::ObjectAdapterPtr _adapter;
+};
+
+#endif
diff --git a/cpp/src/IcePack/ObjectRegistryI.cpp b/cpp/src/IcePack/ObjectRegistryI.cpp
new file mode 100644
index 00000000000..9cad2e21f6e
--- /dev/null
+++ b/cpp/src/IcePack/ObjectRegistryI.cpp
@@ -0,0 +1,185 @@
+// **********************************************************************
+//
+// Copyright (c) 2002
+// ZeroC, Inc.
+// Billerica, MA, USA
+//
+// All Rights Reserved.
+//
+// Ice is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License version 2 as published by
+// the Free Software Foundation.
+//
+// **********************************************************************
+
+#include <IcePack/ObjectRegistryI.h>
+#include <IcePack/TraceLevels.h>
+
+using namespace std;
+using namespace IcePack;
+
+IcePack::ObjectRegistryI::ObjectRegistryI(const Freeze::DBPtr& objDb, const Freeze::DBPtr& typeDb,
+ const TraceLevelsPtr& traceLevels) :
+ _objects(objDb),
+ _types(typeDb),
+ _traceLevels(traceLevels)
+{
+}
+
+void
+IcePack::ObjectRegistryI::add(const ObjectDescription& obj, const Ice::Current&)
+{
+ IceUtil::Mutex::Lock sync(*this);
+
+ Ice::Identity id = obj.proxy->ice_getIdentity();
+
+ IdentityObjectDescDict::iterator p = _objects.find(id);
+ if(p != _objects.end())
+ {
+ throw ObjectExistsException();
+ }
+
+ //
+ // Add the object to the object dictionary.
+ //
+ _objects.insert(make_pair(id, obj));
+
+ //
+ // Add the object to the interface dictionary.
+ //
+ if(!obj.type.empty())
+ {
+ Ice::ObjectProxySeq seq;
+
+ StringObjectProxySeqDict::iterator q = _types.find(obj.type);
+ if(q != _types.end())
+ {
+ seq = q->second;
+ }
+
+ seq.push_back(obj.proxy);
+
+ if(q == _types.end())
+ {
+ _types.insert(make_pair(obj.type, seq));
+ }
+ else
+ {
+ q.set(seq);
+ }
+ }
+
+ if(_traceLevels->objectRegistry > 0)
+ {
+ Ice::Trace out(_traceLevels->logger, _traceLevels->objectRegistryCat);
+ out << "added object `" << Ice::identityToString(id) << "'";
+ }
+}
+
+void
+IcePack::ObjectRegistryI::remove(const Ice::ObjectPrx& object, const Ice::Current&)
+{
+ IceUtil::Mutex::Lock sync(*this);
+
+ Ice::Identity id = object->ice_getIdentity();
+
+ IdentityObjectDescDict::iterator p = _objects.find(id);
+ if(p == _objects.end())
+ {
+ throw ObjectNotExistException();
+ }
+
+ ObjectDescription obj = p->second;
+
+ if(!obj.type.empty())
+ {
+ //
+ // Remove the object from the interface dictionary.
+ //
+ StringObjectProxySeqDict::iterator q = _types.find(obj.type);
+ assert(q != _types.end());
+
+ Ice::ObjectProxySeq seq = q->second;
+
+ Ice::ObjectProxySeq::iterator r;
+ for(r = seq.begin(); r != seq.end(); ++r)
+ {
+ if((*r)->ice_getIdentity() == id)
+ {
+ break;
+ }
+ }
+
+ assert(r != seq.end());
+ seq.erase(r);
+
+ if(seq.size() == 0)
+ {
+ _types.erase(q);
+ }
+ else
+ {
+ q.set(seq);
+ }
+ }
+
+ //
+ // Remove the object from the object dictionary.
+ //
+ _objects.erase(p);
+
+ if(_traceLevels->objectRegistry > 0)
+ {
+ Ice::Trace out(_traceLevels->logger, _traceLevels->objectRegistryCat);
+ out << "removed object `" << id << "'";
+ }
+}
+
+ObjectDescription
+IcePack::ObjectRegistryI::getObjectDescription(const Ice::Identity& id, const Ice::Current&) const
+{
+ IdentityObjectDescDict::const_iterator p = _objects.find(id);
+ if(p == _objects.end())
+ {
+ throw ObjectNotExistException();
+ }
+
+ return p->second;
+}
+
+Ice::ObjectPrx
+IcePack::ObjectRegistryI::findById(const Ice::Identity& id, const Ice::Current&) const
+{
+ IdentityObjectDescDict::const_iterator p = _objects.find(id);
+ if(p == _objects.end())
+ {
+ throw ObjectNotExistException();
+ }
+
+ return p->second.proxy;
+}
+
+Ice::ObjectPrx
+IcePack::ObjectRegistryI::findByType(const string& type, const Ice::Current&) const
+{
+ StringObjectProxySeqDict::const_iterator p = _types.find(type);
+ if(p == _types.end())
+ {
+ throw ObjectNotExistException();
+ }
+
+ int r = rand() % p->second.size();
+ return p->second[r];
+}
+
+Ice::ObjectProxySeq
+IcePack::ObjectRegistryI::findAllWithType(const string& type, const Ice::Current&) const
+{
+ StringObjectProxySeqDict::const_iterator p = _types.find(type);
+ if(p == _types.end())
+ {
+ throw ObjectNotExistException();
+ }
+
+ return p->second;
+}
diff --git a/cpp/src/IcePack/ObjectRegistryI.h b/cpp/src/IcePack/ObjectRegistryI.h
new file mode 100644
index 00000000000..fd58e1eb393
--- /dev/null
+++ b/cpp/src/IcePack/ObjectRegistryI.h
@@ -0,0 +1,52 @@
+// **********************************************************************
+//
+// Copyright (c) 2002
+// ZeroC, Inc.
+// Billerica, MA, USA
+//
+// All Rights Reserved.
+//
+// Ice is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License version 2 as published by
+// the Free Software Foundation.
+//
+// **********************************************************************
+
+#ifndef ICE_PACK_OBJECT_REGISTRY_I_H
+#define ICE_PACK_OBJECT_REGISTRY_I_H
+
+#include <IcePack/Internal.h>
+#include <IcePack/IdentityObjectDescDict.h>
+#include <IcePack/StringObjectProxySeqDict.h>
+
+namespace IcePack
+{
+
+class TraceLevels;
+typedef IceUtil::Handle<TraceLevels> TraceLevelsPtr;
+
+class ObjectRegistryI : public ObjectRegistry, public IceUtil::Mutex
+{
+public:
+
+ ObjectRegistryI(const Freeze::DBPtr&, const Freeze::DBPtr&, const TraceLevelsPtr&);
+
+ virtual void add(const IcePack::ObjectDescription&, const ::Ice::Current&);
+ virtual void remove(const Ice::ObjectPrx&, const ::Ice::Current&);
+
+ virtual ObjectDescription getObjectDescription(const Ice::Identity&, const ::Ice::Current&) const;
+
+ virtual Ice::ObjectPrx findById(const ::Ice::Identity&, const ::Ice::Current&) const;
+ virtual Ice::ObjectPrx findByType(const std::string&, const ::Ice::Current&) const;
+ virtual Ice::ObjectProxySeq findAllWithType(const std::string&, const ::Ice::Current&) const;
+
+private:
+
+ IdentityObjectDescDict _objects;
+ StringObjectProxySeqDict _types;
+ TraceLevelsPtr _traceLevels;
+};
+
+}
+
+#endif