class callback_wrapper - 5cript/attender GitHub Wiki
The callback wrapper provides javascript promise like .then().except() syntax.
| Members | Descriptions |
|---|---|
public inline callback_wrapper() |
|
public template<typename FunctionT> inline callback_wrapper & then(FunctionT const & f)
|
Sets a continuation function. |
public template<typename FunctionT> inline callback_wrapper & then(FunctionT && f)
|
Sets a continuation function. |
public template<typename FunctionT> inline callback_wrapper & except(FunctionT const & f)
|
Sets an error callback. |
public template<typename FunctionT> inline callback_wrapper & except(FunctionT && f)
|
Sets an error callback. |
public inline void fullfill() |
Fullfill the "promise-like" callback wrapper. |
public inline void error(boost::system::error_code const & ec) |
Same as fullfill, but instead of calling the continuation function, it will call the error handler function with the ec. |
public template<typename FunctionT>
inline callback_wrapper & then(FunctionT const & f)
Sets a continuation function.
public template<typename FunctionT>
inline callback_wrapper & then(FunctionT && f)
Sets a continuation function.
public template<typename FunctionT>
inline callback_wrapper & except(FunctionT const & f)
Sets an error callback.
public template<typename FunctionT>
inline callback_wrapper & except(FunctionT && f)
Sets an error callback.
Fullfill the "promise-like" callback wrapper.
Will either call func_ or set a flag, that then calls the function immediately.
Same as fullfill, but instead of calling the continuation function, it will call the error handler function with the ec.