23 #ifndef PDCOM5_FUTURE_H
24 #define PDCOM5_FUTURE_H
26 #include "pdcom5_export.h"
33 template <
class Exception,
class... Result>
49 template <
class Exception,
class... Result>
53 using ResolveFn = std::function<void(Result...)>;
54 using RejectFn = std::function<void(
Exception)>;
59 impl_(std::move(impl))
94 bool empty() const noexcept {
return !impl_.operator bool(); }
99 std::size_t operator()(
Future const &future)
const
110 bool operator()(
const Future &lhs,
const Future &rhs)
const noexcept
112 return std::owner_less<
114 lhs.impl_, rhs.impl_);
121 return other.impl_ == impl_;
130 template <
class Exception,
class... Result>
131 struct hash<
PdCom::Future<Exception, Result...>> :
135 template <
class Exception,
class... Result>
136 struct less<
PdCom::Future<Exception, Result...>> :
Callback management handle.
Definition: Future.h:51
const Future & handle_exception(RejectFn reject) const &
Set error handling callback.
Future handle_exception(RejectFn reject) &&
Set error handling callback.
Future then(ResolveFn resolve) &&
Set continuation callback.
bool operator==(const Future &other) const noexcept
Equal comparsion.
Definition: Future.h:119
const Future & then(ResolveFn resolve) const &
Set continuation callback.
bool empty() const noexcept
Definition: Future.h:94
Future()=default
Default Constructor.
library version string as "major.minor.patch"
Definition: ClientStatistics.h:31
Definition: Exception.h:35
Hash support, e.g. for std::unordered_set.
Definition: Future.h:98
Less compare support, e.g. for std::set.
Definition: Future.h:109