From 3062e1e740a7fc214b0c2a12ced7e82018bbe566 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 17 Jul 2015 19:41:40 -0700 Subject: [PATCH] Message: Add data accessors. --- src/Message.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Message.h b/src/Message.h index 2c73842fb1..e3fcc78235 100644 --- a/src/Message.h +++ b/src/Message.h @@ -47,6 +47,14 @@ class Message { MsgType type() const { return m_type; } bool Is(MsgType type) const { return type == m_type; } + // Message data accessors. Callers are responsible for knowing what data is + // actually provided for a particular message. + const std::string& str() const { return m_str; } + std::shared_ptr value() const { return m_value; } + unsigned int id() const { return m_id; } + unsigned int flags() const { return m_flags; } + unsigned int seq_num_uid() const { return m_seq_num_uid; } + // Read and write from wire representation void Write(WireEncoder& encoder) const; static std::shared_ptr Read(WireDecoder& decoder,