15#include "wvlinklist.h"
16#include "wvstreamsdebugger.h"
19typedef wv::function<
void*(
void*)> WvContCallback;
42 static DataList *data_list;
47 static void bouncer(
void *userdata);
54 {
return _call(data); }
60 static void *_call(Data *data);
74 WvCont(
const WvContCallback &cb,
unsigned long stacksize = 64*1024);
130 template <
typename R,
typename T>
134 return (R)cont((T)t);
151 template <
typename R>
160 WvStreamsDebugger::ResultCallback result_cb,
void *);
WvCont provides "continuations", which are apparently also known as semi-coroutines.
void * operator()(void *p1=0)
call the callback, making p1 the return value of yield() or the parameter to the function,...
static R c_bouncer(void *_cont)
A templated function that allows you to pass a WvCont wherever a C-style function pointer of the form...
static WvCont current()
Get a copy of the current WvCont.
static R c_bouncer(T t, void *_cont)
A templated function that allows you to pass a WvCont wherever a C-style function pointer of the form...
WvCont(const WvContCallback &cb, unsigned long stacksize=64 *1024)
Construct a WvCont using an existing WvCallback.
static void * yield(void *ret=0)
"return" from the current callback, giving value 'ret' to the person who called us.
static bool isok()
Tell us if the current context is "okay", that is, not trying to die.
WvCont(const WvCont &cb)
Copy constructor.
A WvFastString acts exactly like a WvString, but can take (const char *) strings without needing to a...
A linked list container class.
This is a WvList of WvStrings, and is a really handy way to parse strings.
WvString is an implementation of a simple and efficient printable-string class.