|
| AsyncOp ()=default |
| AsyncOp (const AsyncOp &other)=delete |
AsyncOp & | operator= (const AsyncOp &other)=delete |
AsyncOp & | operator= (AsyncOp &&other) noexcept=default |
| AsyncOp (AsyncOp &&other) noexcept=default |
| ~AsyncOp () override |
void | setReady (value_type &&val) |
bool | isReady () const |
template<typename Fun> |
void | onReady (Fun &&cb) |
value_type & | get () |
virtual bool | canCancel () |
virtual void | cancel () |
SignalProxy< void()> | sigStarted () |
SignalProxy< void(const std::string &, int, int)> | sigProgress () |
SignalProxy< void()> | sigReady () |
| Base () |
virtual | ~Base () |
WeakPtr | parent () const |
void | addChild (const Base::Ptr &child) |
void | removeChild (const Ptr &child) |
const std::unordered_set< Ptr > & | children () const |
std::thread::id | threadId () const |
template<typename T> |
std::vector< std::weak_ptr< T > > | findChildren () const |
template<typename T> |
std::shared_ptr< T > | shared_this () const |
template<typename T> |
std::shared_ptr< T > | shared_this () |
template<typename T> |
std::weak_ptr< T > | weak_this () const |
template<typename T> |
std::weak_ptr< T > | weak_this () |
template<typename SenderFunc, typename ReceiverFunc> |
auto | connect (SenderFunc &&sFun, typename internal::MemberFunction< ReceiverFunc >::ClassType &recv, ReceiverFunc &&rFunc) |
template<typename SenderFunc, typename ReceiverFunc, typename ... Tracker> |
std::enable_if_t< std::is_member_function_pointer_v< SenderFunc >, connection > | connectFunc (SenderFunc &&sFun, ReceiverFunc &&rFunc, const Tracker &...trackers) |
|
template<typename Obj, typename Functor> |
static decltype(auto) | make_base_slot (Obj *o, Functor &&f) |
template<typename SenderFunc, typename ReceiverFunc> |
static auto | connect (typename internal::MemberFunction< SenderFunc >::ClassType &s, SenderFunc &&sFun, typename internal::MemberFunction< ReceiverFunc >::ClassType &recv, ReceiverFunc &&rFunc) |
template<typename SenderFunc, typename ReceiverFunc, typename ... Tracker> |
static auto | connectFunc (typename internal::MemberFunction< SenderFunc >::ClassType &s, SenderFunc &&sFun, ReceiverFunc &&rFunc, const Tracker &...trackers) |
| Base (BasePrivate &dd) |
Signal< void()> | _sigStarted |
Signal< void()> | _sigReady |
Signal< void(const std::string &, int, int)> | _sigProgress |
std::unique_ptr< BasePrivate > | d_ptr |
template<typename Result>
class zyppng::AsyncOp< Result >
The AsyncOp template class is the basic building block for the asynchronous pipelines. Its the base for all async callbacks as well as the async result type. That basically means every pipeline is just a AsyncOp that contains all previous operations that were defined in the pipeline.
When implementing a async operation that is to be used in a pipeline it is required to add a operator() to the class taking the input parameter. After the operation is finished the implementation must call setReady(). Calling setReady() must be treated like calling return in a normal function and not execute anymore code on the AsyncOp instance afterwards, since the next operation in the pipeline is allowed to free the previous operation as soon as it gets ready.
In case no next operation is defined on the AsyncOp ( when the instance is used as result object ) the return value is cached internally and can be retrieved with
- See also
- get().
A async operation can be cancelled by releasing the result object ( the resulting combinatory object ), this will destroy all previous operations that are either running or pending as well. The destructors MUST NOT call setReady() but only release currently running operations.
Definition at line 161 of file asyncop.h.