]> git.proxmox.com Git - ceph.git/blob - ceph/src/messages/MMgrClose.h
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / messages / MMgrClose.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3
4 #pragma once
5
6 #include "msg/Message.h"
7
8 class MMgrClose : public Message {
9 private:
10
11 static constexpr int HEAD_VERSION = 1;
12 static constexpr int COMPAT_VERSION = 1;
13
14 public:
15 std::string daemon_name;
16 std::string service_name; // optional; otherwise infer from entity type
17
18 void decode_payload() override
19 {
20 using ceph::decode;
21 auto p = payload.cbegin();
22 decode(daemon_name, p);
23 decode(service_name, p);
24 }
25
26 void encode_payload(uint64_t features) override {
27 using ceph::encode;
28 encode(daemon_name, payload);
29 encode(service_name, payload);
30 }
31
32 std::string_view get_type_name() const override { return "mgrclose"; }
33 void print(std::ostream& out) const override {
34 out << get_type_name() << "(";
35 if (service_name.length()) {
36 out << service_name;
37 } else {
38 out << ceph_entity_type_name(get_source().type());
39 }
40 out << "." << daemon_name;
41 out << ")";
42 }
43
44 MMgrClose()
45 : Message{MSG_MGR_CLOSE, HEAD_VERSION, COMPAT_VERSION}
46 {}
47
48 private:
49 template<class T, typename... Args>
50 friend boost::intrusive_ptr<T> ceph::make_message(Args&&... args);
51 };