// ********************************************************************** // // Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. // // ********************************************************************** #ifndef ICE_GRID_NODECACHE_H #define ICE_GRID_NODECACHE_H #include #include #include #include namespace IceGrid { class NodeCache; class NodeSessionI; typedef IceUtil::Handle NodeSessionIPtr; class ServerEntry; typedef IceUtil::Handle ServerEntryPtr; class NodeEntry : public IceUtil::Shared, public IceUtil::Mutex { public: NodeEntry(Cache&, const std::string&); void addServer(const ServerEntryPtr&); void removeServer(const ServerEntryPtr&); void setSession(const NodeSessionIPtr&); NodePrx getProxy() const; Ice::StringSeq getServers() const; bool canRemove(); private: Cache& _cache; const std::string _name; NodeSessionIPtr _session; std::map _servers; }; typedef IceUtil::Handle NodeEntryPtr; class NodeCache : public CacheByString { public: NodeEntryPtr get(const std::string&, bool = false) const; }; }; #endif