// // Copyright (c) ZeroC, Inc. All rights reserved. // #ifndef ICE_ROUTING_TABLE_H #define ICE_ROUTING_TABLE_H #include #include #include #include #include #include namespace Glacier2 { class RoutingTable final { public: RoutingTable(std::shared_ptr, std::shared_ptr); void destroy(); std::shared_ptr updateObserver(const std::shared_ptr&, const std::string&, const std::shared_ptr&); // Returns evicted proxies. Ice::ObjectProxySeq add(const Ice::ObjectProxySeq&, const Ice::Current&); std::shared_ptr get(const Ice::Identity&); // Returns null if no proxy can be found. private: const std::shared_ptr _communicator; const int _traceLevel; const int _maxSize; const std::shared_ptr _verifier; struct EvictorEntry; using EvictorMap = std::map>; using EvictorQueue = std::list; friend struct EvictorEntry; struct EvictorEntry { std::shared_ptr proxy; EvictorQueue::iterator pos; }; EvictorMap _map; EvictorQueue _queue; IceInternal::ObserverHelperT _observer; std::mutex _mutex; }; } #endif