LeechCraft  0.6.70-3565-g2d86529
Modular cross-platform feature rich live environment.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
LeechCraft::Util::detail::SequenceProxy< Ret, E0, A0 > 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< E0, A0...> *sequencer)
 Constructs a sequencer proxy managing the given sequencer. More...
 
 SequenceProxy (SequenceProxy &&proxy)=default
 Move-constructs from proxy. More...
 
template<typename F >
auto Then (const F &f) -> SequenceProxy< UnwrapFutureType_t< decltype(f(std::declval< Ret >()))>, E0, A0...>
 Adds the functor f to the chain of actions. More...
 
template<typename F >
auto Then (const F &f) -> typename std::enable_if< std::is_same< void, decltype(f(std::declval< Ret >()))>::value >::type
 Adds the funtor f to the chain of actions and closes the chain. More...
 

Public Attributes

 Seq_
 

Detailed Description

template<typename Ret, typename E0, typename... A0>
class LeechCraft::Util::detail::SequenceProxy< Ret, E0, A0 >

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 295 of file futures.h.

Member Typedef Documentation

template<typename Ret , typename E0 , typename... A0>
using LeechCraft::Util::detail::SequenceProxy< Ret, E0, A0 >::Ret_t = Ret

Definition at line 306 of file futures.h.

Constructor & Destructor Documentation

template<typename Ret , typename E0 , typename... A0>
LeechCraft::Util::detail::SequenceProxy< Ret, E0, A0 >::SequenceProxy ( Sequencer< E0, A0...> *  sequencer)
inline

Constructs a sequencer proxy managing the given sequencer.

Parameters
[in]sequencerThe sequencer to manage.

Definition at line 313 of file futures.h.

template<typename Ret , typename E0 , typename... A0>
LeechCraft::Util::detail::SequenceProxy< Ret, E0, A0 >::SequenceProxy ( SequenceProxy< Ret, E0, A0 > &&  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 E0 , typename... A0>
template<typename F >
auto LeechCraft::Util::detail::SequenceProxy< Ret, E0, A0 >::Then ( const F &  f) -> SequenceProxy<UnwrapFutureType_t<decltype (f (std::declval<Ret> ()))>, E0, A0...>
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 348 of file futures.h.

template<typename Ret , typename E0 , typename... A0>
template<typename F >
auto LeechCraft::Util::detail::SequenceProxy< Ret, E0, A0 >::Then ( const F &  f) -> typename std::enable_if<std::is_same<void, decltype (f (std::declval<Ret> ()))>::value>::type
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 367 of file futures.h.

Member Data Documentation

template<typename Ret , typename E0 , typename... A0>
LeechCraft::Util::detail::SequenceProxy< Ret, E0, A0 >::Seq_
Initial value:
{ sequencer }
{
}
SequenceProxy (const SequenceProxy& proxy) = default

Definition at line 315 of file futures.h.


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