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 ...
Definition: wvstream.h:25
WvTimeStream causes select() to be true after a configurable number of milliseconds.
Definition: wvtimestream.h:23
virtual void execute()
The callback() function calls execute(), and then calls the user- specified callback if one is define...
Definition: wvtimestream.cc:72
void set_timer(time_t msec)
Every 'msec' milliseconds, select() will return true on this stream.
Definition: wvtimestream.cc:15
virtual bool post_select(SelectInfo &si)
post_select() is called after ::select(), and returns true if this object is now ready.
Definition: wvtimestream.cc:64
virtual bool isok() const
return true if the stream is actually usable right now
Definition: wvtimestream.cc:25
virtual void pre_select(SelectInfo &si)
pre_select() sets up for eventually calling ::select().
Definition: wvtimestream.cc:31
Based on (and interchangeable with) struct timeval.
Definition: wvtimeutils.h:18
the data structure used by pre_select()/post_select() and internally by select().
Definition: iwvstream.h:50