WvStreams
debian/libwvstreams-dev/usr/include/wvstreams/wvtimestream.h
1/* -*- Mode: C++ -*-
2 * Worldvisions Weaver Software:
3 * Copyright (C) 1997-2002 Net Integration Technologies, Inc.
4 *
5 */
6#ifndef __WVTIMESTREAM_H
7#define __WVTIMESTREAM_H
8
9#include "wvtimeutils.h"
10#include "wvstream.h"
11
22class WvTimeStream : public WvStream
23{
24 WvTime last;
25 WvTime next;
26 time_t ms_per_tick;
27
28public:
30
43 void set_timer(time_t msec);
44
45 virtual bool isok() const;
46 virtual void pre_select(SelectInfo &si);
47 virtual bool post_select(SelectInfo &si);
48 virtual void execute();
49
50public:
51 const char *wstype() const { return "WvTimeStream"; }
52};
53
54
55#endif // __WVTIMESTREAM_H
Unified support for streams, that is, sequences of bytes that may or may not be ready for read/write ...
WvTimeStream causes select() to be true after a configurable number of milliseconds.
virtual void execute()
The callback() function calls execute(), and then calls the user- specified callback if one is define...
void set_timer(time_t msec)
Every 'msec' milliseconds, select() will return true on this stream.
virtual bool post_select(SelectInfo &si)
post_select() is called after select(), and returns true if this object is now ready.
virtual bool isok() const
return true if the stream is actually usable right now
virtual void pre_select(SelectInfo &si)
pre_select() sets up for eventually calling select().
Based on (and interchangeable with) struct timeval.
the data structure used by pre_select()/post_select() and internally by select().