]>
Commit | Line | Data |
---|---|---|
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 | * Portions Copyright (C) 2014 CohortFS, LLC | |
8 | * | |
9 | * This is free software; you can redistribute it and/or | |
10 | * modify it under the terms of the GNU Lesser General Public | |
11 | * License version 2.1, as published by the Free Software | |
12 | * Foundation. See file COPYING. | |
13 | * | |
14 | */ | |
15 | ||
16 | #ifndef CEPH_MSG_NOP_H | |
17 | #define CEPH_MSG_NOP_H | |
18 | ||
19 | #include "msg/Message.h" | |
20 | #include "msg/msg_types.h" | |
21 | ||
22 | /* | |
23 | * A message with no (remote) effect. | |
24 | */ | |
11fdf7f2 | 25 | class MNop : public MessageInstance<MNop> { |
7c673cae | 26 | public: |
11fdf7f2 TL |
27 | friend factory; |
28 | ||
29 | static constexpr int HEAD_VERSION = 1; | |
30 | static constexpr int COMPAT_VERSION = 1; | |
7c673cae FG |
31 | |
32 | __u32 tag; // ignored tag value | |
33 | ||
34 | MNop() | |
11fdf7f2 | 35 | : MessageInstance(MSG_NOP, HEAD_VERSION, COMPAT_VERSION) |
7c673cae FG |
36 | {} |
37 | ||
38 | ~MNop() {} | |
39 | ||
40 | void encode_payload(uint64_t _features) { | |
11fdf7f2 TL |
41 | using ceph::encode; |
42 | encode(tag, payload); | |
7c673cae FG |
43 | } |
44 | ||
45 | void decode_payload() { | |
11fdf7f2 TL |
46 | auto p = payload.cbegin(); |
47 | decode(tag, p); | |
7c673cae FG |
48 | } |
49 | ||
11fdf7f2 | 50 | std::string_view get_type_name() const { return "MNop"; } |
7c673cae FG |
51 | |
52 | void print(ostream& out) const { | |
53 | out << get_type_name() << " "; | |
54 | } | |
55 | }; /* MNop */ | |
56 | ||
57 | #endif /* CEPH_MSG_NOP_H */ |