qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject svn commit: r1510597 - in /qpid/trunk/qpid/cpp: include/qpid/types/Uuid.h src/qpid/ha/BrokerInfo.h src/qpid/ha/Primary.h src/qpid/ha/QueueGuard.h src/qpid/ha/QueueReplicator.h src/qpid/ha/QueueSnapshots.h src/qpid/ha/RemoteBackup.h src/qpid/ha/hash.h
Date Mon, 05 Aug 2013 16:35:13 GMT
Author: aconway
Date: Mon Aug  5 16:35:13 2013
New Revision: 1510597

URL: http://svn.apache.org/r1510597
Log:
NO-JIRA: Corrected use of boost_hash, failing to build on some compilers.

Removed:
    qpid/trunk/qpid/cpp/src/qpid/ha/hash.h
Modified:
    qpid/trunk/qpid/cpp/include/qpid/types/Uuid.h
    qpid/trunk/qpid/cpp/src/qpid/ha/BrokerInfo.h
    qpid/trunk/qpid/cpp/src/qpid/ha/Primary.h
    qpid/trunk/qpid/cpp/src/qpid/ha/QueueGuard.h
    qpid/trunk/qpid/cpp/src/qpid/ha/QueueReplicator.h
    qpid/trunk/qpid/cpp/src/qpid/ha/QueueSnapshots.h
    qpid/trunk/qpid/cpp/src/qpid/ha/RemoteBackup.h

Modified: qpid/trunk/qpid/cpp/include/qpid/types/Uuid.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/include/qpid/types/Uuid.h?rev=1510597&r1=1510596&r2=1510597&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/include/qpid/types/Uuid.h (original)
+++ qpid/trunk/qpid/cpp/include/qpid/types/Uuid.h Mon Aug  5 16:35:13 2013
@@ -82,6 +82,9 @@ class QPID_TYPES_CLASS_EXTERN Uuid
     unsigned char bytes[16];
 };
 
+/** Hash value function for use with boots::hash or std::hash */
+inline size_t hash_value(const Uuid& uuid) { return uuid.hash(); }
+
 /** Returns true if the uuids are equal, false otherwise. **/
 QPID_TYPES_EXTERN bool operator==(const Uuid&, const Uuid&);
 /** Returns true if the uuids are NOT equal, false if they are. **/

Modified: qpid/trunk/qpid/cpp/src/qpid/ha/BrokerInfo.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/ha/BrokerInfo.h?rev=1510597&r1=1510596&r2=1510597&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/ha/BrokerInfo.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/ha/BrokerInfo.h Mon Aug  5 16:35:13 2013
@@ -28,6 +28,7 @@
 #include "qpid/types/Uuid.h"
 #include "qpid/types/Variant.h"
 #include "qpid/sys/unordered_map.h"
+#include <boost/functional/hash.hpp>
 #include <string>
 #include <iosfwd>
 #include <vector>
@@ -42,7 +43,8 @@ class BrokerInfo
 {
   public:
     typedef std::set<BrokerInfo> Set;
-    typedef qpid::sys::unordered_map<types::Uuid, BrokerInfo, types::Uuid::Hasher>
Map;
+    typedef qpid::sys::unordered_map<types::Uuid, BrokerInfo,
+                                     boost::hash<types::Uuid> > Map;
 
     BrokerInfo();
     BrokerInfo(const types::Uuid& id, BrokerStatus, const Address& = Address());

Modified: qpid/trunk/qpid/cpp/src/qpid/ha/Primary.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/ha/Primary.h?rev=1510597&r1=1510596&r2=1510597&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/ha/Primary.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/ha/Primary.h Mon Aug  5 16:35:13 2013
@@ -29,9 +29,9 @@
 #include "qpid/sys/Mutex.h"
 #include "qpid/sys/unordered_map.h"
 #include <boost/shared_ptr.hpp>
+#include <boost/functional/hash.hpp>
 #include <boost/intrusive_ptr.hpp>
 #include <string>
-#include <boost/functional/hash.hpp>
 
 namespace qpid {
 
@@ -105,7 +105,7 @@ class Primary : public Role
 
   private:
     typedef sys::unordered_map<
-      types::Uuid, RemoteBackupPtr, types::Uuid::Hasher > BackupMap;
+      types::Uuid, RemoteBackupPtr, boost::hash<types::Uuid> > BackupMap;
 
     typedef std::set<RemoteBackupPtr > BackupSet;
 

Modified: qpid/trunk/qpid/cpp/src/qpid/ha/QueueGuard.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/ha/QueueGuard.h?rev=1510597&r1=1510596&r2=1510597&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/ha/QueueGuard.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/ha/QueueGuard.h Mon Aug  5 16:35:13 2013
@@ -23,12 +23,12 @@
  */
 
 #include "types.h"
-#include "hash.h"
 #include "qpid/types/Uuid.h"
 #include "qpid/sys/Mutex.h"
 #include "qpid/sys/unordered_map.h"
 #include <boost/shared_ptr.hpp>
 #include <boost/intrusive_ptr.hpp>
+#include <boost/functional/hash.hpp>
 #include <deque>
 #include <set>
 
@@ -89,7 +89,7 @@ class QueueGuard {
     class QueueObserver;
     typedef qpid::sys::unordered_map<ReplicationId,
                                      boost::intrusive_ptr<broker::AsyncCompletion>,
-                                     TrivialHasher<ReplicationId> > Delayed;
+                                     boost::hash<ReplicationId> > Delayed;
 
     bool complete(ReplicationId, sys::Mutex::ScopedLock &);
     void complete(Delayed::iterator, sys::Mutex::ScopedLock &);

Modified: qpid/trunk/qpid/cpp/src/qpid/ha/QueueReplicator.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/ha/QueueReplicator.h?rev=1510597&r1=1510596&r2=1510597&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/ha/QueueReplicator.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/ha/QueueReplicator.h Mon Aug  5 16:35:13 2013
@@ -23,9 +23,9 @@
  */
 
 #include "BrokerInfo.h"
-#include "hash.h"
 #include "qpid/broker/Exchange.h"
 #include <boost/enable_shared_from_this.hpp>
+#include <boost/functional/hash.hpp>
 #include <boost/function.hpp>
 #include <iosfwd>
 
@@ -106,7 +106,7 @@ class QueueReplicator : public broker::E
 
   private:
     typedef qpid::sys::unordered_map<
-      ReplicationId, QueuePosition, TrivialHasher<int32_t> > PositionMap;
+      ReplicationId, QueuePosition, boost::hash<int32_t> > PositionMap;
     class ErrorListener;
     class QueueObserver;
 

Modified: qpid/trunk/qpid/cpp/src/qpid/ha/QueueSnapshots.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/ha/QueueSnapshots.h?rev=1510597&r1=1510596&r2=1510597&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/ha/QueueSnapshots.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/ha/QueueSnapshots.h Mon Aug  5 16:35:13 2013
@@ -24,7 +24,6 @@
 
 
 #include "QueueSnapshot.h"
-#include "hash.h"
 
 #include "qpid/assert.h"
 #include "qpid/broker/BrokerObserver.h"
@@ -32,6 +31,7 @@
 #include "qpid/sys/Mutex.h"
 
 #include <boost/shared_ptr.hpp>
+#include <boost/functional/hash.hpp>
 
 namespace qpid {
 namespace ha {
@@ -67,10 +67,10 @@ class QueueSnapshots : public broker::Br
     }
 
   private:
-    typedef qpid::sys::unordered_map<boost::shared_ptr<broker::Queue>,
-                                     boost::shared_ptr<QueueSnapshot>,
-                                     SharedPtrHasher<broker::Queue>
-                                     > SnapshotMap;
+    typedef qpid::sys::unordered_map<
+      boost::shared_ptr<broker::Queue>, boost::shared_ptr<QueueSnapshot>,
+      boost::hash<boost::shared_ptr<broker::Queue> > > SnapshotMap;
+
     SnapshotMap snapshots;
     mutable sys::Mutex lock;
 };

Modified: qpid/trunk/qpid/cpp/src/qpid/ha/RemoteBackup.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/ha/RemoteBackup.h?rev=1510597&r1=1510596&r2=1510597&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/ha/RemoteBackup.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/ha/RemoteBackup.h Mon Aug  5 16:35:13 2013
@@ -25,8 +25,8 @@
 #include "ReplicationTest.h"
 #include "BrokerInfo.h"
 #include "types.h"
-#include "hash.h"
 #include "qpid/sys/unordered_map.h"
+#include <boost/functional/hash.hpp>
 #include <set>
 
 namespace qpid {
@@ -97,7 +97,7 @@ class RemoteBackup
 
   private:
     typedef qpid::sys::unordered_map<QueuePtr, GuardPtr,
-                                     SharedPtrHasher<broker::Queue> > GuardMap;
+                                     boost::hash<QueuePtr> > GuardMap;
     typedef std::set<QueuePtr> QueueSet;
 
     std::string logPrefix;



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message