// // Copyright (c) ZeroC, Inc. All rights reserved. // #ifndef ICE_GRID_REPLICACACHE_H #define ICE_GRID_REPLICACACHE_H #include #include #include namespace IceGrid { class ReplicaCache; class ReplicaSessionI; class ReplicaEntry final { public: ReplicaEntry(const std::string&, const std::shared_ptr&); bool canRemove() const { return true; } const std::shared_ptr& getSession() const; std::shared_ptr getInfo() const; std::shared_ptr getProxy() const; std::shared_ptr getAdminProxy() const; private: const std::string _name; const std::shared_ptr _session; }; class ReplicaCache final : public CacheByString { public: ReplicaCache(const std::shared_ptr&, const std::shared_ptr&); std::shared_ptr add(const std::string&, const std::shared_ptr&); std::shared_ptr remove(const std::string&, bool); std::shared_ptr get(const std::string&) const; void subscribe(const std::shared_ptr&); void unsubscribe(const std::shared_ptr&); std::shared_ptr getEndpoints(const std::string&, const std::shared_ptr&) const; void setInternalRegistry(const std::shared_ptr&); std::shared_ptr getInternalRegistry() const; private: const std::shared_ptr _communicator; const std::shared_ptr _topic; const std::shared_ptr _observers; std::shared_ptr _self; // This replica internal registry proxy. }; }; #endif