2 * Worldvisions Weaver Software:
3 * Copyright (C) 1997-2002 Net Integration Technologies, Inc.
5 #ifndef __WVBATCHSIGNAL_H
6 #define __WVBATCHSIGNAL_H
9 #include <wvistreamlist.h>
13 class WvInvertedStream
: public WvStream
16 WvInvertedStream(char *_id
):
19 WvIStreamList::globallist
.append(this, false, _id
);
23 WvIStreamList::globallist
.unlink(this);
29 * This class is a functor compatible with UniConfCallback,
30 * IWvStreamCallback and WvStreamCallback, as well as supporting being
31 * called with no parameters.
33 * It will turn any number of calls to any of these callbacks into a
34 * single call to the callback you give to it, which will be sent on
35 * the next run through the main loop.
37 * Think of it as an elevator button: pressing it a bunch of times has
38 * no more effect than pressing it once, and while it doesn't do what
39 * you tell it right away, it will do it soon enough.
44 WvBellPull(WvCallback
<> _cb
):
46 bellpull(new WvInvertedStream("bellpull"))
48 bellpull
->setcallback(
49 WvStreamCallback(this, &WvBellPull::bellpull_cb
), NULL
);
52 WvBellPull(const WvBellPull
& _other
):
54 bellpull(_other
.bellpull
)
63 void delay(time_t msec_timeout
)
65 bellpull
->alarm(msec_timeout
);
75 void operator()(IWvStream
&)
79 void operator()(WvStream
&, void*)
83 void operator()(const UniConf
&, const UniConfKey
&)
90 WvInvertedStream
*bellpull
;
92 void bellpull_cb(WvStream
&, void*)
98 #endif /* __WVBATCHSIGNAL_H */