1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
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.
16 #ifndef CEPH_MCLIENTRECLAIMREPLY_H
17 #define CEPH_MCLIENTRECLAIMREPLY_H
19 #include "msg/Message.h"
21 class MClientReclaimReply final
: public SafeMessage
{
23 static constexpr int HEAD_VERSION
= 1;
24 static constexpr int COMPAT_VERSION
= 1;
26 int32_t get_result() const { return result
; }
27 void set_result(int r
) { result
= r
; }
28 epoch_t
get_epoch() const { return epoch
; }
29 void set_epoch(epoch_t e
) { epoch
= e
; }
30 const entity_addrvec_t
& get_addrs() const { return addrs
; }
31 void set_addrs(const entity_addrvec_t
& _addrs
) { addrs
= _addrs
; }
33 std::string_view
get_type_name() const override
{ return "client_reclaim_reply"; }
34 void print(std::ostream
& o
) const override
{
35 o
<< "client_reclaim_reply(" << result
<< " e " << epoch
<< ")";
38 void encode_payload(uint64_t features
) override
{
40 encode(result
, payload
);
41 encode(epoch
, payload
);
42 encode(addrs
, payload
, features
);
45 void decode_payload() override
{
47 auto p
= payload
.cbegin();
54 MClientReclaimReply() :
55 MClientReclaimReply
{0, 0}
57 MClientReclaimReply(int r
, epoch_t e
=0) :
58 SafeMessage
{CEPH_MSG_CLIENT_RECLAIM_REPLY
, HEAD_VERSION
, COMPAT_VERSION
},
59 result(r
), epoch(e
) {}
62 ~MClientReclaimReply() final
{}
66 entity_addrvec_t addrs
;
68 template<class T
, typename
... Args
>
69 friend boost::intrusive_ptr
<T
> ceph::make_message(Args
&&... args
);
70 template<class T
, typename
... Args
>
71 friend MURef
<T
> crimson::make_message(Args
&&... args
);