diff options
author | Sage Weil <sage.weil@dreamhost.com> | 2012-01-30 13:28:44 -0800 |
---|---|---|
committer | Sage Weil <sage.weil@dreamhost.com> | 2012-01-30 13:28:53 -0800 |
commit | 9987f8f95cf2e6f9d7619e50a8b7742762d974ee (patch) | |
tree | 0d6e55838dc8e6099af5dd00b6685920cd022643 /src/msg/Message.h | |
parent | 9279619b56cf1183e18cbdcedf63f53c90059197 (diff) | |
download | ceph-9987f8f95cf2e6f9d7619e50a8b7742762d974ee.tar.gz |
msg: go const-crazy on messages
- get_type_name()
- print()
and all the random crap they call.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Diffstat (limited to 'src/msg/Message.h')
-rw-r--r-- | src/msg/Message.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/msg/Message.h b/src/msg/Message.h index 6159b9d4bbf..53d216a4678 100644 --- a/src/msg/Message.h +++ b/src/msg/Message.h @@ -380,7 +380,7 @@ public: off_t get_data_len() { return data.length(); } void set_recv_stamp(utime_t t) { recv_stamp = t; } - utime_t get_recv_stamp() { return recv_stamp; } + utime_t get_recv_stamp() const { return recv_stamp; } void calc_header_crc() { header.crc = ceph_crc32c_le(0, (unsigned char*)&header, @@ -395,47 +395,47 @@ public: } // type - int get_type() { return header.type; } + int get_type() const { return header.type; } void set_type(int t) { header.type = t; } - uint64_t get_tid() { return header.tid; } + uint64_t get_tid() const { return header.tid; } void set_tid(uint64_t t) { header.tid = t; } - unsigned get_seq() { return header.seq; } + unsigned get_seq() const { return header.seq; } void set_seq(unsigned s) { header.seq = s; } - unsigned get_priority() { return header.priority; } + unsigned get_priority() const { return header.priority; } void set_priority(__s16 p) { header.priority = p; } // source/dest - entity_inst_t get_source_inst() { + entity_inst_t get_source_inst() const { return entity_inst_t(get_source(), get_source_addr()); } - entity_name_t get_source() { + entity_name_t get_source() const { return entity_name_t(header.src); } - entity_addr_t get_source_addr() { + entity_addr_t get_source_addr() const { if (connection) return connection->get_peer_addr(); return entity_addr_t(); } // forwarded? - entity_inst_t get_orig_source_inst() { + entity_inst_t get_orig_source_inst() const { return get_source_inst(); } - entity_name_t get_orig_source() { + entity_name_t get_orig_source() const { return get_orig_source_inst().name; } - entity_addr_t get_orig_source_addr() { + entity_addr_t get_orig_source_addr() const { return get_orig_source_inst().addr; } // virtual bits virtual void decode_payload() = 0; virtual void encode_payload(uint64_t features) = 0; - virtual const char *get_type_name() = 0; - virtual void print(ostream& out) { + virtual const char *get_type_name() const = 0; + virtual void print(ostream& out) const { out << get_type_name(); } |