diff options
author | Benoit Foucher <benoit@zeroc.com> | 2002-06-28 19:20:18 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2002-06-28 19:20:18 +0000 |
commit | 75ac12c02d537f38b03567e406cbeccf29226fe0 (patch) | |
tree | 4add4682e2aa8edd9c58f1a23ad3f0ccc8336d02 /cpp/src/Ice/LocatorInfo.h | |
parent | Replaced invalid struct name Struct with Structure. (diff) | |
download | ice-75ac12c02d537f38b03567e406cbeccf29226fe0.tar.bz2 ice-75ac12c02d537f38b03567e406cbeccf29226fe0.tar.xz ice-75ac12c02d537f38b03567e406cbeccf29226fe0.zip |
Merged location branch.
Diffstat (limited to 'cpp/src/Ice/LocatorInfo.h')
-rw-r--r-- | cpp/src/Ice/LocatorInfo.h | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/cpp/src/Ice/LocatorInfo.h b/cpp/src/Ice/LocatorInfo.h new file mode 100644 index 00000000000..9bee858982f --- /dev/null +++ b/cpp/src/Ice/LocatorInfo.h @@ -0,0 +1,86 @@ +// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_LOCATOR_INFO_H +#define ICE_LOCATOR_INFO_H + +#include <IceUtil/Shared.h> +#include <IceUtil/Mutex.h> +#include <Ice/LocatorInfoF.h> +#include <Ice/LocatorF.h> +#include <Ice/ProxyF.h> +#include <Ice/EndpointF.h> + +namespace IceInternal +{ + +class LocatorManager : public ::IceUtil::Shared, public ::IceUtil::Mutex +{ +public: + + LocatorManager(); + + void destroy(); + + // + // Returns locator info for a given locator. Automatically creates + // the locator info if it doesn't exist yet. + // + LocatorInfoPtr get(const ::Ice::LocatorPrx&); + +private: + + std::map< ::Ice::LocatorPrx, LocatorInfoPtr> _table; + std::map< ::Ice::LocatorPrx, LocatorInfoPtr>::iterator _tableHint; + + std::map< ::Ice::Identity, LocatorAdapterTablePtr> _adapterTables; +}; + +class LocatorAdapterTable : public ::IceUtil::Shared, public ::IceUtil::Mutex +{ +public: + LocatorAdapterTable(); + + bool get(const std::string&, ::std::vector<EndpointPtr>&) const; + void add(const std::string&, const ::std::vector<EndpointPtr>&); + void remove(const std::string&); + +private: + + std::map<std::string, std::vector<EndpointPtr> > _adapterEndpointsMap; +}; + +class LocatorInfo : public ::IceUtil::Shared, public ::IceUtil::Mutex +{ +public: + + LocatorInfo(const ::Ice::LocatorPrx&, const LocatorAdapterTablePtr&); + + bool operator==(const LocatorInfo&) const; + bool operator!=(const LocatorInfo&) const; + bool operator<(const LocatorInfo&) const; + + ::Ice::LocatorPrx getLocator(); + ::Ice::LocatorRegistryPrx getLocatorRegistry(); + + bool getEndpoints(const ReferencePtr&, ::std::vector<EndpointPtr>&) const; + void addEndpoints(const ReferencePtr&, const ::std::vector<EndpointPtr>&); + void removeEndpoints(const ReferencePtr&); + +private: + + ::Ice::LocatorPrx _locator; + ::Ice::LocatorRegistryPrx _locatorRegistry; + LocatorAdapterTablePtr _adapterTable; +}; + +} + +#endif |