]>
Commit | Line | Data |
---|---|---|
1 | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- | |
2 | // vim: ts=8 sw=2 smarttab | |
3 | ||
4 | #include "journal/Future.h" | |
5 | #include "journal/FutureImpl.h" | |
6 | #include "include/ceph_assert.h" | |
7 | ||
8 | namespace journal { | |
9 | ||
10 | Future::Future() = default; | |
11 | Future::Future(const Future& o) = default; | |
12 | Future& Future::operator=(const Future& o) = default; | |
13 | Future::Future(Future&& o) = default; | |
14 | Future& Future::operator=(Future&& o) = default; | |
15 | Future::Future(ceph::ref_t<FutureImpl> future_impl) : m_future_impl(std::move(future_impl)) {} | |
16 | Future::~Future() = default; | |
17 | ||
18 | void Future::flush(Context *on_safe) { | |
19 | m_future_impl->flush(on_safe); | |
20 | } | |
21 | ||
22 | void Future::wait(Context *on_safe) { | |
23 | ceph_assert(on_safe != NULL); | |
24 | m_future_impl->wait(on_safe); | |
25 | } | |
26 | ||
27 | bool Future::is_complete() const { | |
28 | return m_future_impl->is_complete(); | |
29 | } | |
30 | ||
31 | int Future::get_return_value() const { | |
32 | return m_future_impl->get_return_value(); | |
33 | } | |
34 | ||
35 | std::ostream &operator<<(std::ostream &os, const Future &future) { | |
36 | return os << *future.m_future_impl; | |
37 | } | |
38 | ||
39 | } // namespace journal | |
40 |