diff options
author | Benoit Foucher <benoit@zeroc.com> | 2006-04-24 09:46:12 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2006-04-24 09:46:12 +0000 |
commit | a5fdbf7412b96cecd45314f9d9eb37aaf77a2bf1 (patch) | |
tree | a2f26b3e3207ac925239385101f18a5459da1664 /cpp/src/IceGrid/ObjectCache.h | |
parent | Unix Fix. (diff) | |
download | ice-a5fdbf7412b96cecd45314f9d9eb37aaf77a2bf1.tar.bz2 ice-a5fdbf7412b96cecd45314f9d9eb37aaf77a2bf1.tar.xz ice-a5fdbf7412b96cecd45314f9d9eb37aaf77a2bf1.zip |
Added first cut of the allocation mechanism.
Diffstat (limited to 'cpp/src/IceGrid/ObjectCache.h')
-rw-r--r-- | cpp/src/IceGrid/ObjectCache.h | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/cpp/src/IceGrid/ObjectCache.h b/cpp/src/IceGrid/ObjectCache.h index d89cd5858b8..cbc31e9405d 100644 --- a/cpp/src/IceGrid/ObjectCache.h +++ b/cpp/src/IceGrid/ObjectCache.h @@ -15,6 +15,7 @@ #include <Ice/CommunicatorF.h> #include <IceGrid/Cache.h> #include <IceGrid/Internal.h> +#include <IceGrid/Allocatable.h> namespace IceGrid { @@ -24,10 +25,7 @@ class ObjectCache; class ServerEntry; typedef IceUtil::Handle<ServerEntry> ServerEntryPtr; -class ObjectEntry; -typedef IceUtil::Handle<ObjectEntry> ObjectEntryPtr; - -class ObjectEntry : public IceUtil::Shared +class ObjectEntry : public Allocatable { public: @@ -67,6 +65,33 @@ private: std::map<std::string, std::set<Ice::Identity> > _types; }; +class ObjectAllocationRequest : public AllocationRequest +{ +public: + + ObjectAllocationRequest(const SessionIPtr& session) : AllocationRequest(session) { } + + virtual void response(const Ice::ObjectPrx&) = 0; + +private: + + virtual void allocated(const AllocatablePtr& allocatable) + { + response(ObjectEntryPtr::dynamicCast(allocatable)->getProxy()); + } + + virtual void timeout() + { + response(0); + } + + virtual void canceled() + { + response(0); + } +}; +typedef IceUtil::Handle<ObjectAllocationRequest> ObjectAllocationRequestPtr; + }; #endif |