]> git.proxmox.com Git - ceph.git/blob - ceph/src/tools/rbd_mirror/BaseRequest.h
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / tools / rbd_mirror / BaseRequest.h
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_RBD_MIRROR_BASE_REQUEST_H
5 #define CEPH_RBD_MIRROR_BASE_REQUEST_H
6
7 #include "include/Context.h"
8
9 namespace rbd {
10 namespace mirror {
11
12 class BaseRequest {
13 public:
14 BaseRequest(Context *on_finish) : m_on_finish(on_finish) {
15 }
16 virtual ~BaseRequest() {}
17
18 virtual void send() = 0;
19
20 protected:
21 virtual void finish(int r) {
22 m_on_finish->complete(r);
23 delete this;
24 }
25
26 private:
27 Context *m_on_finish;
28 };
29
30 } // namespace mirror
31 } // namespace rbd
32
33 #endif // CEPH_RBD_MIRROR_BASE_REQUEST_H