]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/messages/MCommandReply.h
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / messages / MCommandReply.h
index c5d93d0ef7c67d411afeaacaa4b480c213128ade..d740565b0afc27f22b91b2a49ff5617e56069154 100644 (file)
 #ifndef CEPH_MCOMMANDREPLY_H
 #define CEPH_MCOMMANDREPLY_H
 
-#include <boost/utility/string_view.hpp>
+#include <string_view>
 
 #include "msg/Message.h"
 #include "MCommand.h"
 
-class MCommandReply : public Message {
- public:
+class MCommandReply : public MessageInstance<MCommandReply> {
+public:
+  friend factory;
+
   errorcode32_t r;
   string rs;
   
   MCommandReply()
-    : Message(MSG_COMMAND_REPLY) {}
+    : MessageInstance(MSG_COMMAND_REPLY) {}
   MCommandReply(MCommand *m, int _r)
-    : Message(MSG_COMMAND_REPLY), r(_r) {
+    : MessageInstance(MSG_COMMAND_REPLY), r(_r) {
     header.tid = m->get_tid();
   }
-  MCommandReply(int _r, boost::string_view s)
-    : Message(MSG_COMMAND_REPLY),
+  MCommandReply(int _r, std::string_view s)
+    : MessageInstance(MSG_COMMAND_REPLY),
       r(_r), rs(s) { }
 private:
   ~MCommandReply() override {}
 
 public:
-  const char *get_type_name() const override { return "command_reply"; }
+  std::string_view get_type_name() const override { return "command_reply"; }
   void print(ostream& o) const override {
     o << "command_reply(tid " << get_tid() << ": " << r << " " << rs << ")";
   }
   
   void encode_payload(uint64_t features) override {
-    ::encode(r, payload);
-    ::encode(rs, payload);
+    using ceph::encode;
+    encode(r, payload);
+    encode(rs, payload);
   }
   void decode_payload() override {
-    bufferlist::iterator p = payload.begin();
-    ::decode(r, p);
-    ::decode(rs, p);
+    auto p = payload.cbegin();
+    decode(r, p);
+    decode(rs, p);
   }
 };