]>
Commit | Line | Data |
---|---|---|
f67539c2 TL |
1 | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- |
2 | // vim: ts=8 sw=2 smarttab | |
3 | ||
4 | #ifndef CEPH_MESSAGES_MMDSPING_H | |
5 | #define CEPH_MESSAGES_MMDSPING_H | |
6 | ||
7 | #include "include/types.h" | |
8 | #include "messages/MMDSOp.h" | |
9 | ||
10 | class MMDSPing final : public MMDSOp { | |
11 | private: | |
12 | static constexpr int HEAD_VERSION = 1; | |
13 | static constexpr int COMPAT_VERSION = 1; | |
14 | public: | |
15 | version_t seq; | |
16 | ||
17 | protected: | |
18 | MMDSPing() : MMDSOp(MSG_MDS_PING, HEAD_VERSION, COMPAT_VERSION) { | |
19 | } | |
20 | MMDSPing(version_t seq) | |
21 | : MMDSOp(MSG_MDS_PING, HEAD_VERSION, COMPAT_VERSION), seq(seq) { | |
22 | } | |
23 | ~MMDSPing() final {} | |
24 | ||
25 | public: | |
26 | std::string_view get_type_name() const override { | |
27 | return "mdsping"; | |
28 | } | |
29 | ||
20effc67 | 30 | void print(std::ostream &out) const override { |
f67539c2 TL |
31 | out << "mdsping"; |
32 | } | |
33 | ||
34 | void encode_payload(uint64_t features) override { | |
35 | using ceph::encode; | |
36 | encode(seq, payload); | |
37 | } | |
38 | ||
39 | void decode_payload() override { | |
40 | using ceph::decode; | |
41 | auto iter = payload.cbegin(); | |
42 | decode(seq, iter); | |
43 | } | |
44 | ||
45 | private: | |
46 | template<class T, typename... Args> | |
47 | friend boost::intrusive_ptr<T> ceph::make_message(Args&&... args); | |
20effc67 TL |
48 | template<class T, typename... Args> |
49 | friend MURef<T> crimson::make_message(Args&&... args); | |
f67539c2 TL |
50 | }; |
51 | ||
52 | #endif // CEPH_MESSAGES_MMDSPING_H |