qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From astitc...@apache.org
Subject svn commit: r800921 - in /qpid/trunk/qpid/cpp/src/qpid/cluster: Cluster.cpp Cluster.h Cpg.cpp Cpg.h
Date Tue, 04 Aug 2009 19:04:43 GMT
Author: astitcher
Date: Tue Aug  4 19:04:43 2009
New Revision: 800921

URL: http://svn.apache.org/viewvc?rev=800921&view=rev
Log:
Fixes for cluster code to compile with new stricter corosync header files

Modified:
    qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp
    qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.h
    qpid/trunk/qpid/cpp/src/qpid/cluster/Cpg.cpp
    qpid/trunk/qpid/cpp/src/qpid/cluster/Cpg.h

Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp?rev=800921&r1=800920&r2=800921&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp Tue Aug  4 19:04:43 2009
@@ -315,7 +315,7 @@
 // Deliver CPG message.
 void Cluster::deliver(
     cpg_handle_t /*handle*/,
-    cpg_name* /*group*/,
+    const cpg_name* /*group*/,
     uint32_t nodeid,
     uint32_t pid,
     void* msg,
@@ -507,10 +507,10 @@
 
 void Cluster::configChange ( 
     cpg_handle_t /*handle*/,
-    cpg_name */*group*/,
-    cpg_address *current, int nCurrent,
-    cpg_address *left, int nLeft,
-    cpg_address */*joined*/, int /*nJoined*/)
+    const cpg_name */*group*/,
+    const cpg_address *current, int nCurrent,
+    const cpg_address *left, int nLeft,
+    const cpg_address */*joined*/, int /*nJoined*/)
 {
     Mutex::ScopedLock l(lock);
     if (state == INIT) {        // First config change.
@@ -521,7 +521,7 @@
     QPID_LOG(notice, *this << " membership change: " << AddrList(current, nCurrent)
              << AddrList(left, nLeft, "left: "));
     std::string addresses;
-    for (cpg_address* p = current; p < current+nCurrent; ++p) 
+    for (const cpg_address* p = current; p < current+nCurrent; ++p) 
         addresses.append(MemberId(*p).str());
     deliverEvent(Event::control(ClusterConfigChangeBody(ProtocolVersion(), addresses), self));
 }

Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.h?rev=800921&r1=800920&r2=800921&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.h Tue Aug  4 19:04:43 2009
@@ -169,7 +169,7 @@
     // == Called in CPG dispatch thread
     void deliver( // CPG deliver callback. 
         cpg_handle_t /*handle*/,
-        struct cpg_name *group,
+        const struct cpg_name *group,
         uint32_t /*nodeid*/,
         uint32_t /*pid*/,
         void* /*msg*/,
@@ -179,10 +179,10 @@
     
     void configChange( // CPG config change callback.
         cpg_handle_t /*handle*/,
-        struct cpg_name */*group*/,
-        struct cpg_address */*members*/, int /*nMembers*/,
-        struct cpg_address */*left*/, int /*nLeft*/,
-        struct cpg_address */*joined*/, int /*nJoined*/
+        const struct cpg_name */*group*/,
+        const struct cpg_address */*members*/, int /*nMembers*/,
+        const struct cpg_address */*left*/, int /*nLeft*/,
+        const struct cpg_address */*joined*/, int /*nJoined*/
     );
 
     // == Called in management threads.

Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/Cpg.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/Cpg.cpp?rev=800921&r1=800920&r2=800921&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/Cpg.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/Cpg.cpp Tue Aug  4 19:04:43 2009
@@ -49,6 +49,28 @@
 // Global callback functions.
 void Cpg::globalDeliver (
     cpg_handle_t handle,
+    const struct cpg_name *group,
+    uint32_t nodeid,
+    uint32_t pid,
+    void* msg,
+    size_t msg_len)
+{
+    cpgFromHandle(handle)->handler.deliver(handle, group, nodeid, pid, msg, msg_len);
+}
+
+void Cpg::globalConfigChange(
+    cpg_handle_t handle,
+    const struct cpg_name *group,
+    const struct cpg_address *members, size_t nMembers,
+    const struct cpg_address *left, size_t nLeft,
+    const struct cpg_address *joined, size_t nJoined
+)
+{
+    cpgFromHandle(handle)->handler.configChange(handle, group, members, nMembers, left,
nLeft, joined, nJoined);
+}
+
+void Cpg::globalDeliver (
+    cpg_handle_t handle,
     struct cpg_name *group,
     uint32_t nodeid,
     uint32_t pid,

Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/Cpg.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/Cpg.h?rev=800921&r1=800920&r2=800921&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/Cpg.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/Cpg.h Tue Aug  4 19:04:43 2009
@@ -68,7 +68,7 @@
         virtual ~Handler() {};
         virtual void deliver(
             cpg_handle_t /*handle*/,
-            struct cpg_name *group,
+            const struct cpg_name *group,
             uint32_t /*nodeid*/,
             uint32_t /*pid*/,
             void* /*msg*/,
@@ -76,10 +76,10 @@
 
         virtual void configChange(
             cpg_handle_t /*handle*/,
-            struct cpg_name */*group*/,
-            struct cpg_address */*members*/, int /*nMembers*/,
-            struct cpg_address */*left*/, int /*nLeft*/,
-            struct cpg_address */*joined*/, int /*nJoined*/
+            const struct cpg_name */*group*/,
+            const struct cpg_address */*members*/, int /*nMembers*/,
+            const struct cpg_address */*left*/, int /*nLeft*/,
+            const struct cpg_address */*joined*/, int /*nJoined*/
         ) = 0;
     };
 
@@ -122,6 +122,24 @@
 
     static Cpg* cpgFromHandle(cpg_handle_t);
 
+    // New versions for corosync 1.0 and higher
+    static void globalDeliver(
+        cpg_handle_t handle,
+        const struct cpg_name *group,
+        uint32_t nodeid,
+        uint32_t pid,
+        void* msg,
+        size_t msg_len);
+
+    static void globalConfigChange(
+        cpg_handle_t handle,
+        const struct cpg_name *group,
+        const struct cpg_address *members, size_t nMembers,
+        const struct cpg_address *left, size_t nLeft,
+        const struct cpg_address *joined, size_t nJoined
+    );
+
+    // Old versions for openais
     static void globalDeliver(
         cpg_handle_t handle,
         struct cpg_name *group,



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message