summaryrefslogtreecommitdiff
path: root/cppe/src/IceE/Reference.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cppe/src/IceE/Reference.cpp')
-rw-r--r--cppe/src/IceE/Reference.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/cppe/src/IceE/Reference.cpp b/cppe/src/IceE/Reference.cpp
index 26aaa044409..234ec78dd71 100644
--- a/cppe/src/IceE/Reference.cpp
+++ b/cppe/src/IceE/Reference.cpp
@@ -106,7 +106,7 @@ IceInternal::Reference::changeFacet(const string& newFacet) const
Int
Reference::hash() const
{
- IceUtil::Mutex::Lock sync(_hashMutex);
+ IceUtil::RecMutex::Lock sync(_hashMutex);
if(_hashInitialized)
{
@@ -590,6 +590,11 @@ IceInternal::RoutableReference::changeRouter(const RouterPrx& newRouter) const
return r;
}
+int
+IceInternal::RoutableReference::hash() const
+{
+ return Reference::hash();
+}
bool
IceInternal::RoutableReference::operator==(const Reference& r) const
@@ -1050,6 +1055,23 @@ IceInternal::IndirectReference::getConnection() const
return connection;
}
+int
+IceInternal::IndirectReference::hash() const
+{
+ IceUtil::RecMutex::Lock sync(_hashMutex);
+
+ if(_hashInitialized)
+ {
+ return _hashValue;
+ }
+ RoutableReference::hash(); // Initializes _hashValue.
+ for(string::const_iterator p = _adapterId.begin(); p != _adapterId.end(); ++p) // Add hash of adapter ID to base hash.
+ {
+ _hashValue = 5 * _hashValue + *p;
+ }
+ return _hashValue;
+}
+
bool
IceInternal::IndirectReference::operator==(const Reference& r) const
{