diff options
Diffstat (limited to 'cpp/src/Ice/RouterInfo.h')
-rw-r--r-- | cpp/src/Ice/RouterInfo.h | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/cpp/src/Ice/RouterInfo.h b/cpp/src/Ice/RouterInfo.h new file mode 100644 index 00000000000..15fa489175e --- /dev/null +++ b/cpp/src/Ice/RouterInfo.h @@ -0,0 +1,74 @@ +// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_ROUTER_INFO_H +#define ICE_ROUTER_INFO_H + +#include <IceUtil/Shared.h> +#include <IceUtil/Mutex.h> +#include <Ice/RouterInfoF.h> +#include <Ice/RouterF.h> +#include <Ice/ProxyF.h> +#include <Ice/RoutingTableF.h> + +namespace IceInternal +{ + +class RouterManager : public ::IceUtil::Shared, public ::IceUtil::Mutex +{ +public: + + RouterManager(); + + void destroy(); + + // + // Returns router info for a given router. Automatically creates + // the router info if it doesn't exist yet. + // + RouterInfoPtr get(const ::Ice::RouterPrx&); + +private: + + std::map< ::Ice::RouterPrx, RouterInfoPtr> _table; + std::map< ::Ice::RouterPrx, RouterInfoPtr>::iterator _tableHint; +}; + +class RouterInfo : public ::IceUtil::Shared, public ::IceUtil::Mutex +{ +public: + + RouterInfo(const ::Ice::RouterPrx&); + + bool operator==(const RouterInfo&) const; + bool operator!=(const RouterInfo&) const; + bool operator<(const RouterInfo&) const; + + ::Ice::RouterPrx getRouter(); + ::Ice::ObjectPrx getClientProxy(); + void setClientProxy(const ::Ice::ObjectPrx&); + ::Ice::ObjectPrx getServerProxy(); + void setServerProxy(const ::Ice::ObjectPrx&); + void addProxy(const ::Ice::ObjectPrx&); + void setAdapter(const ::Ice::ObjectAdapterPtr&); + ::Ice::ObjectAdapterPtr getAdapter(); + +private: + + ::Ice::RouterPrx _router; + ::Ice::ObjectPrx _clientProxy; + ::Ice::ObjectPrx _serverProxy; + RoutingTablePtr _routingTable; + ::Ice::ObjectAdapterPtr _adapter; +}; + +} + +#endif |