WvStreams
Public Member Functions | List of all members
WvDelayedCallback< Functor > Class Template Reference

A WvCallback wrapper that delays until the next tick of the WvIStreamList main loop. More...

#include <wvdelayedcallback.h>

Public Member Functions

 WvDelayedCallback (const Functor &_func)
 
 WvDelayedCallback (const WvDelayedCallback &other)
 
void operator() ()
 
template<typename P1 >
void operator() (P1 &p1)
 
template<typename P1 , typename P2 >
void operator() (P1 &p1, P2 &p2)
 
template<typename P1 , typename P2 , typename P3 >
void operator() (P1 &p1, P2 &p2, P3 &p3)
 
template<typename P1 , typename P2 , typename P3 , typename P4 >
void operator() (P1 &p1, P2 &p2, P3 &p3, P4 &p4)
 
template<typename P1 , typename P2 , typename P3 , typename P4 , typename P5 >
void operator() (P1 &p1, P2 &p2, P3 &p3, P4 &p4, P5 &p5)
 
template<typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 >
void operator() (P1 &p1, P2 &p2, P3 &p3, P4 &p4, P5 &p5, P6 &p6)
 
template<typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7 >
void operator() (P1 &p1, P2 &p2, P3 &p3, P4 &p4, P5 &p5, P6 &p6, P7 &p7)
 
template<typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7 , typename P8 >
void operator() (P1 &p1, P2 &p2, P3 &p3, P4 &p4, P5 &p5, P6 &p6, P7 &p7, P8 &p8)
 

Detailed Description

template<class Functor>
class WvDelayedCallback< Functor >

A WvCallback wrapper that delays until the next tick of the WvIStreamList main loop.

There are restrictions on the type of the wrapped callback though:

  1. The return type must be void
  2. All parameter types must be copy-constructible value types

Example: setcallback(wv::delayed(mycallback));

FIXME: Because operator() makes a copy of the inner callback and thaw() destroys the copy, nesting WvDelayedCallback doesn't work as you might expect. That is, don't do: wv::delayed(wv::delayed(mycallback)). It creates a copy of the inner WvDelayedCallback, but that copy gets frozen, then destroyed before it has a chance to thaw! Anyway, it's a stupid thing to do anyway, so don't.

Definition at line 30 of file wvdelayedcallback.h.

Constructor & Destructor Documentation

◆ WvDelayedCallback() [1/2]

template<class Functor >
WvDelayedCallback< Functor >::WvDelayedCallback ( const Functor &  _func)
inline

Definition at line 38 of file wvdelayedcallback.h.

◆ WvDelayedCallback() [2/2]

template<class Functor >
WvDelayedCallback< Functor >::WvDelayedCallback ( const WvDelayedCallback< Functor > &  other)
inline

Definition at line 43 of file wvdelayedcallback.h.

◆ ~WvDelayedCallback()

template<class Functor >
WvDelayedCallback< Functor >::~WvDelayedCallback ( )
inline

Definition at line 48 of file wvdelayedcallback.h.

Member Function Documentation

◆ operator()() [1/9]

template<class Functor >
void WvDelayedCallback< Functor >::operator() ( )
inline

Definition at line 52 of file wvdelayedcallback.h.

◆ operator()() [2/9]

template<class Functor >
template<typename P1 >
void WvDelayedCallback< Functor >::operator() ( P1 &  p1)
inline

Definition at line 58 of file wvdelayedcallback.h.

◆ operator()() [3/9]

template<class Functor >
template<typename P1 , typename P2 >
void WvDelayedCallback< Functor >::operator() ( P1 &  p1,
P2 &  p2 
)
inline

Definition at line 65 of file wvdelayedcallback.h.

◆ operator()() [4/9]

template<class Functor >
template<typename P1 , typename P2 , typename P3 >
void WvDelayedCallback< Functor >::operator() ( P1 &  p1,
P2 &  p2,
P3 &  p3 
)
inline

Definition at line 73 of file wvdelayedcallback.h.

◆ operator()() [5/9]

template<class Functor >
template<typename P1 , typename P2 , typename P3 , typename P4 >
void WvDelayedCallback< Functor >::operator() ( P1 &  p1,
P2 &  p2,
P3 &  p3,
P4 &  p4 
)
inline

Definition at line 82 of file wvdelayedcallback.h.

◆ operator()() [6/9]

template<class Functor >
template<typename P1 , typename P2 , typename P3 , typename P4 , typename P5 >
void WvDelayedCallback< Functor >::operator() ( P1 &  p1,
P2 &  p2,
P3 &  p3,
P4 &  p4,
P5 &  p5 
)
inline

Definition at line 92 of file wvdelayedcallback.h.

◆ operator()() [7/9]

template<class Functor >
template<typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 >
void WvDelayedCallback< Functor >::operator() ( P1 &  p1,
P2 &  p2,
P3 &  p3,
P4 &  p4,
P5 &  p5,
P6 &  p6 
)
inline

Definition at line 103 of file wvdelayedcallback.h.

◆ operator()() [8/9]

template<class Functor >
template<typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7 >
void WvDelayedCallback< Functor >::operator() ( P1 &  p1,
P2 &  p2,
P3 &  p3,
P4 &  p4,
P5 &  p5,
P6 &  p6,
P7 &  p7 
)
inline

Definition at line 115 of file wvdelayedcallback.h.

◆ operator()() [9/9]

template<class Functor >
template<typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7 , typename P8 >
void WvDelayedCallback< Functor >::operator() ( P1 &  p1,
P2 &  p2,
P3 &  p3,
P4 &  p4,
P5 &  p5,
P6 &  p6,
P7 &  p7,
P8 &  p8 
)
inline

Definition at line 128 of file wvdelayedcallback.h.


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