LeechCraft  0.6.70-6645-gcd10d7e
Modular cross-platform feature rich live environment.
LeechCraft::Util::detail::SequenceProxy< Ret, Future, DestructionTag > Class Template Reference

A proxy object allowing type-checked sequencing of actions and responsible for starting the initial action. More...

#include "futures.h"

Public Types

using Ret_t = Ret
 

Public Member Functions

 SequenceProxy (Sequencer< Future > *sequencer)
 Constructs a sequencer proxy managing the given sequencer. More...
 
 SequenceProxy (const SequenceProxy &proxy)=delete
 Copy-constructs from proxy. More...
 
 SequenceProxy (SequenceProxy &&proxy)=default
 Move-constructs from proxy. More...
 
template<typename F >
auto Then (F &&f) -> SequenceProxy< UnwrapFutureType_t< decltype(f(std::declval< Ret >()))>, Future, DestructionTag >
 Adds the functor f to the chain of actions. More...
 
template<typename F >
auto Then (F &&f) -> EnableIf_t< std::is_same< void, decltype(f(std::declval< Ret >()))>::value >
 Adds the funtor f to the chain of actions and closes the chain. More...
 
template<typename F >
auto Then (F &&f) -> EnableIf_t< std::is_same< void, Ret >::value &&std::is_same< void, decltype(f())>::value >
 
template<typename F >
auto operator>> (F &&f) -> decltype(this->Then(std::forward< F >(f)))
 
template<typename F >
SequenceProxy< Ret, Future, ResultOf_t< F()> > DestructionValue (F &&f)
 
 operator QFuture< Ret > ()
 

Friends

template<typename , typename , typename >
class SequenceProxy
 

Detailed Description

template<typename Ret, typename Future, typename DestructionTag>
class LeechCraft::Util::detail::SequenceProxy< Ret, Future, DestructionTag >

A proxy object allowing type-checked sequencing of actions and responsible for starting the initial action.

SequenceProxy manages a Sequencer object, which itself is directly responsible for walking the chain of sequenced actions.

Internally, objects of this class are reference-counted. As soon as the last instance is destroyed, the initial action is started.

Template Parameters
RetThe type T that QFuture<T> returned by the last chained executor is specialized with.
E0The type of the first executor.
A0The types of the arguments to the executor E0.

Definition at line 422 of file futures.h.

Member Typedef Documentation

template<typename Ret , typename Future , typename DestructionTag >
using LeechCraft::Util::detail::SequenceProxy< Ret, Future, DestructionTag >::Ret_t = Ret

Definition at line 442 of file futures.h.

Constructor & Destructor Documentation

template<typename Ret , typename Future , typename DestructionTag >
LeechCraft::Util::detail::SequenceProxy< Ret, Future, DestructionTag >::SequenceProxy ( Sequencer< Future > *  sequencer)
inline

Constructs a sequencer proxy managing the given sequencer.

Parameters
[in]sequencerThe sequencer to manage.

Definition at line 449 of file futures.h.

References LeechCraft::Util::detail::Sequencer< Future >::Start().

+ Here is the call graph for this function:

template<typename Ret , typename Future , typename DestructionTag >
LeechCraft::Util::detail::SequenceProxy< Ret, Future, DestructionTag >::SequenceProxy ( const SequenceProxy< Ret, Future, DestructionTag > &  proxy)
delete

Copy-constructs from proxy.

Parameters
[in]proxyThe proxy object to share the managed sequencer with.
template<typename Ret , typename Future , typename DestructionTag >
LeechCraft::Util::detail::SequenceProxy< Ret, Future, DestructionTag >::SequenceProxy ( SequenceProxy< Ret, Future, DestructionTag > &&  proxy)
default

Move-constructs from proxy.

Parameters
[in]proxyThe proxy object from which the sequencer should be borrowed.

Member Function Documentation

template<typename Ret , typename Future , typename DestructionTag >
template<typename F >
SequenceProxy<Ret, Future, ResultOf_t<F ()> > LeechCraft::Util::detail::SequenceProxy< Ret, Future, DestructionTag >::DestructionValue ( F &&  f)
inline

Definition at line 530 of file futures.h.

template<typename Ret , typename Future , typename DestructionTag >
LeechCraft::Util::detail::SequenceProxy< Ret, Future, DestructionTag >::operator QFuture< Ret > ( )
inline

Definition at line 538 of file futures.h.

template<typename Ret , typename Future , typename DestructionTag >
template<typename F >
auto LeechCraft::Util::detail::SequenceProxy< Ret, Future, DestructionTag >::operator>> ( F &&  f) -> decltype (this->Then (std::forward<F> (f)))
inline

Definition at line 524 of file futures.h.

template<typename Ret , typename Future , typename DestructionTag >
template<typename F >
auto LeechCraft::Util::detail::SequenceProxy< Ret, Future, DestructionTag >::Then ( F &&  f) -> SequenceProxy<UnwrapFutureType_t<decltype (f (std::declval<Ret> ()))>, Future, DestructionTag>
inline

Adds the functor f to the chain of actions.

The functor f should return QFuture<T0> when called with a value of type Ret. That is, the expression f (std::declval<Ret> ()) should be well-formed, and, moreover, its return type should be QFuture<T0> for some T0.

Parameters
[in]fThe functor to chain.
Returns
An object of type SequencerProxy<T0, E0, A0> ready for chaining new functions.
Template Parameters
FThe type of the functor to chain.

Definition at line 484 of file futures.h.

template<typename Ret , typename Future , typename DestructionTag >
template<typename F >
auto LeechCraft::Util::detail::SequenceProxy< Ret, Future, DestructionTag >::Then ( F &&  f) -> EnableIf_t<std::is_same<void, decltype (f (std::declval<Ret> ()))>::value>
inline

Adds the funtor f to the chain of actions and closes the chain.

The function f should return void when called with a value of type Ret.

No more functors may be chained after adding a void-returning functor.

Parameters
[in]fThe functor to chain.
Template Parameters
FThe type of the functor to chain.

Definition at line 506 of file futures.h.

template<typename Ret , typename Future , typename DestructionTag >
template<typename F >
auto LeechCraft::Util::detail::SequenceProxy< Ret, Future, DestructionTag >::Then ( F &&  f) -> EnableIf_t<std::is_same<void, Ret>::value && std::is_same<void, decltype (f ())>::value>
inline

Definition at line 515 of file futures.h.

Friends And Related Function Documentation

template<typename Ret , typename Future , typename DestructionTag >
template<typename , typename , typename >
friend class SequenceProxy
friend

Definition at line 425 of file futures.h.


The documentation for this class was generated from the following file: