]> git.proxmox.com Git - ceph.git/blame - ceph/src/messages/MMonCommandAck.h
import 15.2.0 Octopus source
[ceph.git] / ceph / src / messages / MMonCommandAck.h
CommitLineData
7c673cae
FG
1// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2// vim: ts=8 sw=2 smarttab
3/*
4 * Ceph - scalable distributed file system
5 *
6 * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
7 *
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.
12 *
13 */
14
15#ifndef CEPH_MMONCOMMANDACK_H
16#define CEPH_MMONCOMMANDACK_H
17
18#include "messages/PaxosServiceMessage.h"
19
9f95a23c 20class MMonCommandAck : public PaxosServiceMessage {
11fdf7f2 21public:
9f95a23c 22 std::vector<std::string> cmd;
7c673cae 23 errorcode32_t r;
9f95a23c
TL
24 std::string rs;
25
26 MMonCommandAck() : PaxosServiceMessage{MSG_MON_COMMAND_ACK, 0} {}
27 MMonCommandAck(const std::vector<std::string>& c, int _r, std::string s, version_t v) :
28 PaxosServiceMessage{MSG_MON_COMMAND_ACK, v},
7c673cae
FG
29 cmd(c), r(_r), rs(s) { }
30private:
31 ~MMonCommandAck() override {}
32
33public:
11fdf7f2 34 std::string_view get_type_name() const override { return "mon_command"; }
9f95a23c 35 void print(std::ostream& o) const override {
7c673cae
FG
36 o << "mon_command_ack(" << cmd << "=" << r << " " << rs << " v" << version << ")";
37 }
38
39 void encode_payload(uint64_t features) override {
11fdf7f2 40 using ceph::encode;
7c673cae 41 paxos_encode();
11fdf7f2
TL
42 encode(r, payload);
43 encode(rs, payload);
44 encode(cmd, payload);
7c673cae
FG
45 }
46 void decode_payload() override {
9f95a23c 47 using ceph::decode;
11fdf7f2 48 auto p = payload.cbegin();
7c673cae 49 paxos_decode(p);
11fdf7f2
TL
50 decode(r, p);
51 decode(rs, p);
52 decode(cmd, p);
7c673cae 53 }
9f95a23c
TL
54private:
55 template<class T, typename... Args>
56 friend boost::intrusive_ptr<T> ceph::make_message(Args&&... args);
7c673cae
FG
57};
58
59#endif