1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation. See file COPYING.
15 #ifndef CEPH_MCOMMANDREPLY_H
16 #define CEPH_MCOMMANDREPLY_H
18 #include "msg/Message.h"
21 class MCommandReply : public Message {
27 : Message(MSG_COMMAND_REPLY) {}
28 MCommandReply(MCommand *m, int _r)
29 : Message(MSG_COMMAND_REPLY), r(_r) {
30 header.tid = m->get_tid();
32 MCommandReply(int _r, string s)
33 : Message(MSG_COMMAND_REPLY),
36 ~MCommandReply() override {}
39 const char *get_type_name() const override { return "command_reply"; }
40 void print(ostream& o) const override {
41 o << "command_reply(tid " << get_tid() << ": " << r << " " << rs << ")";
44 void encode_payload(uint64_t features) override {
46 ::encode(rs, payload);
48 void decode_payload() override {
49 bufferlist::iterator p = payload.begin();