diff options
author | Joe George <joe@zeroc.com> | 2021-01-28 16:26:44 -0500 |
---|---|---|
committer | Joe George <joe@zeroc.com> | 2021-02-01 16:59:30 -0500 |
commit | 92a6531e409f2691d82591e185a92299d415fc0f (patch) | |
tree | 60c79e2a8f327b8f0b6ebc06b06f48a2e8086f6a /cpp/src/IceGrid/ReplicaCache.h | |
parent | Port Glacier2, IceBox, IceBridge, IceDB, IceXML, icegriddb (diff) | |
download | ice-92a6531e409f2691d82591e185a92299d415fc0f.tar.bz2 ice-92a6531e409f2691d82591e185a92299d415fc0f.tar.xz ice-92a6531e409f2691d82591e185a92299d415fc0f.zip |
IceGrid and IceStorm
Diffstat (limited to 'cpp/src/IceGrid/ReplicaCache.h')
-rw-r--r-- | cpp/src/IceGrid/ReplicaCache.h | 52 |
1 files changed, 21 insertions, 31 deletions
diff --git a/cpp/src/IceGrid/ReplicaCache.h b/cpp/src/IceGrid/ReplicaCache.h index 9e38f0cadfd..c0c90e9b5eb 100644 --- a/cpp/src/IceGrid/ReplicaCache.h +++ b/cpp/src/IceGrid/ReplicaCache.h @@ -5,8 +5,6 @@ #ifndef ICE_GRID_REPLICACACHE_H #define ICE_GRID_REPLICACACHE_H -#include <IceUtil/Mutex.h> -#include <IceUtil/Shared.h> #include <IceGrid/Cache.h> #include <IceGrid/Internal.h> #include <IceStorm/IceStorm.h> @@ -15,59 +13,51 @@ namespace IceGrid { class ReplicaCache; - class ReplicaSessionI; -typedef IceUtil::Handle<ReplicaSessionI> ReplicaSessionIPtr; -class ReplicaEntry : public IceUtil::Shared +class ReplicaEntry final { public: - ReplicaEntry(const std::string&, const ReplicaSessionIPtr&); - virtual ~ReplicaEntry(); + ReplicaEntry(const std::string&, const std::shared_ptr<ReplicaSessionI>&); bool canRemove() const { return true; } - const ReplicaSessionIPtr& getSession() const; - InternalReplicaInfoPtr getInfo() const; - InternalRegistryPrx getProxy() const; + const std::shared_ptr<ReplicaSessionI>& getSession() const; + std::shared_ptr<InternalReplicaInfo> getInfo() const; + std::shared_ptr<InternalRegistryPrx> getProxy() const; - Ice::ObjectPrx getAdminProxy() const; + std::shared_ptr<Ice::ObjectPrx> getAdminProxy() const; private: const std::string _name; - const ReplicaSessionIPtr _session; + const std::shared_ptr<ReplicaSessionI> _session; }; -typedef IceUtil::Handle<ReplicaEntry> ReplicaEntryPtr; -class ReplicaCache : public CacheByString<ReplicaEntry> +class ReplicaCache final : public CacheByString<ReplicaEntry> { public: -#ifdef __SUNPRO_CC - using CacheByString<ReplicaEntry>::remove; -#endif - - ReplicaCache(const Ice::CommunicatorPtr&, const IceStorm::TopicManagerPrx&); + ReplicaCache(const std::shared_ptr<Ice::Communicator>&, const std::shared_ptr<IceStorm::TopicManagerPrx>&); - ReplicaEntryPtr add(const std::string&, const ReplicaSessionIPtr&); - ReplicaEntryPtr remove(const std::string&, bool); - ReplicaEntryPtr get(const std::string&) const; + std::shared_ptr<ReplicaEntry> add(const std::string&, const std::shared_ptr<ReplicaSessionI>&); + std::shared_ptr<ReplicaEntry> remove(const std::string&, bool); + std::shared_ptr<ReplicaEntry> get(const std::string&) const; - void subscribe(const ReplicaObserverPrx&); - void unsubscribe(const ReplicaObserverPrx&); + void subscribe(const std::shared_ptr<ReplicaObserverPrx>&); + void unsubscribe(const std::shared_ptr<ReplicaObserverPrx>&); - Ice::ObjectPrx getEndpoints(const std::string&, const Ice::ObjectPrx&) const; + std::shared_ptr<Ice::ObjectPrx> getEndpoints(const std::string&, const std::shared_ptr<Ice::ObjectPrx>&) const; - void setInternalRegistry(const InternalRegistryPrx&); - InternalRegistryPrx getInternalRegistry() const; + void setInternalRegistry(const std::shared_ptr<InternalRegistryPrx>&); + std::shared_ptr<InternalRegistryPrx> getInternalRegistry() const; private: - const Ice::CommunicatorPtr _communicator; - const IceStorm::TopicPrx _topic; - const ReplicaObserverPrx _observers; - InternalRegistryPrx _self; // This replica internal registry proxy. + const std::shared_ptr<Ice::Communicator> _communicator; + const std::shared_ptr<IceStorm::TopicPrx> _topic; + const std::shared_ptr<ReplicaObserverPrx> _observers; + std::shared_ptr<InternalRegistryPrx> _self; // This replica internal registry proxy. }; }; |