5 #ifndef GMCAST_NODE_HPP
6 #define GMCAST_NODE_HPP
8 #include "gcomm/types.hpp"
9 #include "gcomm/uuid.hpp"
11 #include "gu_serialize.hpp"
18 std::ostream& operator<<(std::ostream&,
const Node&);
28 Node(
const std::string& addr =
"") : addr_(addr), mcast_addr_(
"") { }
30 const std::string& addr()
const {
return addr_.to_string(); }
31 const std::string& mcast_addr()
const {
return mcast_addr_.to_string(); }
33 size_t unserialize(
const gu::byte_t* buf,
34 const size_t buflen,
const size_t offset)
38 gu_trace (off = gu::unserialize4(buf, buflen, offset, bits));
39 gu_trace (off = addr_.unserialize(buf, buflen, off));
40 gu_trace (off = mcast_addr_.unserialize(buf, buflen, off));
44 size_t serialize(gu::byte_t* buf,
const size_t buflen,
45 const size_t offset)
const
49 gu_trace (off = gu::serialize4(bits, buf, buflen, offset));
50 gu_trace (off = addr_.serialize(buf, buflen, off));
51 gu_trace (off = mcast_addr_.serialize(buf, buflen, off));
55 static size_t serial_size() {
return (4 + 2 * ADDR_SIZE); }
58 static const size_t ADDR_SIZE = 64;
64 inline std::ostream& gcomm::gmcast::operator<<(std::ostream& os,
const Node& n)
70 #endif // GMCAST_NODE_HPP
Definition: gmcast_node.hpp:23