00001 /* 00002 * Worldvisions Weaver Software: 00003 * Copyright (C) 1997-2002 Net Integration Technologies, Inc. 00004 */ 00005 #ifndef __WVTIMESTREAM_H 00006 #define __WVTIMESTREAM_H 00007 00008 #include "wvstream.h" 00009 #include <sys/time.h> 00010 00027 class WvTimeStream : public WvStream 00028 { 00029 struct timeval last_tv; 00030 int ms_per_tick, max_backlog; 00031 00032 public: 00033 WvTimeStream(); 00034 00039 void set_timer(int msec, int max_backlog = 10); 00040 00041 virtual bool isok() const; 00042 virtual bool pre_select(SelectInfo &si); 00043 virtual bool post_select(SelectInfo &si); 00044 00048 void WvTimeStream::tick(); 00049 virtual void execute(); 00050 }; 00051 00052 00053 #endif // __WVTIMESTREAM_H