summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/cluster/Cpg.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2008-09-12 18:07:47 +0000
committerAlan Conway <aconway@apache.org>2008-09-12 18:07:47 +0000
commitebb59131b198b693c5774dd51656fec520ddd770 (patch)
tree688cbbfe3aae8874156cd2ac2bf9430ef3af19df /cpp/src/qpid/cluster/Cpg.cpp
parentad8e400b786c5868d4e0d2aa880625240e44e311 (diff)
downloadqpid-python-ebb59131b198b693c5774dd51656fec520ddd770.tar.gz
Added ClusterMap and test. Moved PollableCondition, PollableQueue to sys.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@694758 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/Cpg.cpp')
-rw-r--r--cpp/src/qpid/cluster/Cpg.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/cpp/src/qpid/cluster/Cpg.cpp b/cpp/src/qpid/cluster/Cpg.cpp
index 96a5b3da43..2a77fa437a 100644
--- a/cpp/src/qpid/cluster/Cpg.cpp
+++ b/cpp/src/qpid/cluster/Cpg.cpp
@@ -183,4 +183,15 @@ ostream& operator<<(ostream& o, const ConnectionId& c) {
return o << c.first << "-" << c.second;
}
+std::string MemberId::str() const {
+ char s[8];
+ reinterpret_cast<uint32_t&>(s[0]) = htonl(first);
+ reinterpret_cast<uint32_t&>(s[4]) = htonl(second);
+ return std::string(s,8);
+}
+
+MemberId::MemberId(const std::string& s) {
+ first = ntohl(reinterpret_cast<const uint32_t&>(s[0]));
+ second = ntohl(reinterpret_cast<const uint32_t&>(s[4]));
+}
}} // namespace qpid::cluster