diff options
| author | Alan Conway <aconway@apache.org> | 2008-09-12 18:07:47 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2008-09-12 18:07:47 +0000 |
| commit | ebb59131b198b693c5774dd51656fec520ddd770 (patch) | |
| tree | 688cbbfe3aae8874156cd2ac2bf9430ef3af19df /cpp/src/qpid/cluster/Cpg.cpp | |
| parent | ad8e400b786c5868d4e0d2aa880625240e44e311 (diff) | |
| download | qpid-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.cpp | 11 |
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 |
