summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/ObjectCache.h
diff options
context:
space:
mode:
authorJoe George <joe@zeroc.com>2021-01-28 16:26:44 -0500
committerJoe George <joe@zeroc.com>2021-02-01 16:59:30 -0500
commit92a6531e409f2691d82591e185a92299d415fc0f (patch)
tree60c79e2a8f327b8f0b6ebc06b06f48a2e8086f6a /cpp/src/IceGrid/ObjectCache.h
parentPort Glacier2, IceBox, IceBridge, IceDB, IceXML, icegriddb (diff)
downloadice-92a6531e409f2691d82591e185a92299d415fc0f.tar.bz2
ice-92a6531e409f2691d82591e185a92299d415fc0f.tar.xz
ice-92a6531e409f2691d82591e185a92299d415fc0f.zip
IceGrid and IceStorm
Diffstat (limited to 'cpp/src/IceGrid/ObjectCache.h')
-rw-r--r--cpp/src/IceGrid/ObjectCache.h27
1 files changed, 11 insertions, 16 deletions
diff --git a/cpp/src/IceGrid/ObjectCache.h b/cpp/src/IceGrid/ObjectCache.h
index 3ad01e04679..a0b3f01bf25 100644
--- a/cpp/src/IceGrid/ObjectCache.h
+++ b/cpp/src/IceGrid/ObjectCache.h
@@ -5,7 +5,6 @@
#ifndef ICE_GRID_OBJECTCACHE_H
#define ICE_GRID_OBJECTCACHE_H
-#include <IceUtil/Mutex.h>
#include <Ice/CommunicatorF.h>
#include <IceGrid/Cache.h>
#include <IceGrid/Internal.h>
@@ -15,12 +14,12 @@ namespace IceGrid
class ObjectCache;
-class ObjectEntry : public IceUtil::Shared
+class ObjectEntry
{
public:
ObjectEntry(const ObjectInfo&, const std::string&, const std::string&);
- Ice::ObjectPrx getProxy() const;
+ std::shared_ptr<Ice::ObjectPrx> getProxy() const;
std::string getType() const;
std::string getApplication() const;
std::string getServer() const;
@@ -34,24 +33,23 @@ private:
const std::string _application;
const std::string _server;
};
-typedef IceUtil::Handle<ObjectEntry> ObjectEntryPtr;
class ObjectCache : public Cache<Ice::Identity, ObjectEntry>
{
public:
- ObjectCache(const Ice::CommunicatorPtr&);
+ ObjectCache(const std::shared_ptr<Ice::Communicator>&);
void add(const ObjectInfo&, const std::string&, const std::string&);
- ObjectEntryPtr get(const Ice::Identity&) const;
+ std::shared_ptr<ObjectEntry> get(const Ice::Identity&) const;
void remove(const Ice::Identity&);
- std::vector<ObjectEntryPtr> getObjectsByType(const std::string&);
+ std::vector<std::shared_ptr<ObjectEntry>> getObjectsByType(const std::string&);
ObjectInfoSeq getAll(const std::string&);
ObjectInfoSeq getAllByType(const std::string&);
- const Ice::CommunicatorPtr& getCommunicator() const { return _communicator; }
+ const std::shared_ptr<Ice::Communicator>& getCommunicator() const { return _communicator; }
private:
@@ -59,22 +57,19 @@ private:
{
public:
- TypeEntry();
+ void add(const std::shared_ptr<ObjectEntry>&);
+ bool remove(const std::shared_ptr<ObjectEntry>&);
- void add(const ObjectEntryPtr&);
- bool remove(const ObjectEntryPtr&);
-
- const std::vector<ObjectEntryPtr>& getObjects() const { return _objects; }
+ const std::vector<std::shared_ptr<ObjectEntry>>& getObjects() const { return _objects; }
private:
- std::vector<ObjectEntryPtr> _objects;
+ std::vector<std::shared_ptr<ObjectEntry>> _objects;
};
- const Ice::CommunicatorPtr _communicator;
+ const std::shared_ptr<Ice::Communicator> _communicator;
std::map<std::string, TypeEntry> _types;
- static std::pointer_to_unary_function<int, unsigned int> _rand;
};
};