Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

wvdailyevent.h

00001 /* -*- Mode: C++ -*-
00002  * Worldvisions Weaver Software:
00003  *   Copyright (C) 1997-2002 Net Integration Technologies, Inc.
00004  *
00005  * A period event stream.
00006  */
00007 
00008 #ifndef __WVDAILYEVENT_H
00009 #define __WVDAILYEVENT_H
00010 
00011 #include "wvstream.h"
00012 
00029 class WvDailyEvent : public WvStream
00030 /**********************************/
00031 {
00032 public:
00044     WvDailyEvent( int _first_hour, int _num_per_day=0, bool _skip_first=true );
00045 
00052     virtual bool pre_select( SelectInfo& si );
00053     virtual bool post_select( SelectInfo& si );
00054 
00055     // execute() and any overridden versions of it must call reset().
00056     virtual void execute();
00057     
00062     void reset();
00063 
00065     virtual bool isok() const;
00066 
00077     void configure( int _first_hour, int _num_per_day=0, bool _skip_first=true );
00078 
00080     void set_num_per_day(int _num_per_day);
00081     
00086     void set_hour( int h )
00087         { configure( h, num_per_day ); }
00088 
00090     time_t next_event() const;
00091 
00092 private:
00093     int     first_hour;
00094     int     num_per_day;
00095     bool    need_reset;
00096     bool    skip_first;
00097     time_t  prev;
00098     
00099     time_t  not_until;
00100 };
00101 
00102 #endif

Generated on Sun Jul 10 15:34:13 2005 for WvStreams by  doxygen 1.4.0