Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

WvDailyEvent Class Reference

#include <wvdailyevent.h>

Inheritance diagram for WvDailyEvent:

WvStream WvStream List of all members.

Public Methods

 WvDailyEvent (int _first_hour, int _num_per_day=0)
virtual bool pre_select (SelectInfo &si)
virtual bool post_select (SelectInfo &si)
virtual void execute ()
void reset ()
virtual bool isok () const
void configure (int _first_hour, int _num_per_day=0)
void set_hour (int h)
 WvDailyEvent (int _first_hour, int _num_per_day=0)
virtual bool pre_select (SelectInfo &si)
virtual bool post_select (SelectInfo &si)
virtual void execute ()
void reset ()
virtual bool isok () const
void configure (int _first_hour, int _num_per_day=0)
void set_hour (int h)

Private Attributes

int first_hour
int num_per_day
bool need_reset
int last_hour
int last_minute

Constructor & Destructor Documentation

WvDailyEvent::WvDailyEvent int    _first_hour,
int    _num_per_day = 0
 

Definition at line 18 of file wvdailyevent.cc.

WvDailyEvent::WvDailyEvent int    _first_hour,
int    _num_per_day = 0
 


Member Function Documentation

void WvDailyEvent::configure int    _first_hour,
int    _num_per_day = 0
 

void WvDailyEvent::configure int    _first_hour,
int    _num_per_day = 0
 

Definition at line 87 of file wvdailyevent.cc.

Referenced by set_hour().

virtual void WvDailyEvent::execute   [virtual]
 

The callback() function calls execute(), and then calls the user- specified callback if one is defined. Do not call execute() directly; call callback() instead.

The default execute() function does nothing.

Note: If you override this function in a derived class, you must call the parent execute() yourself from the derived class.

Reimplemented from WvStream.

void WvDailyEvent::execute   [virtual]
 

The callback() function calls execute(), and then calls the user- specified callback if one is defined. Do not call execute() directly; call callback() instead.

The default execute() function does nothing.

Note: If you override this function in a derived class, you must call the parent execute() yourself from the derived class.

Reimplemented from WvStream.

Definition at line 68 of file wvdailyevent.cc.

References WvStream::execute().

virtual bool WvDailyEvent::isok   const [virtual]
 

return true if the stream is actually usable right now

Reimplemented from WvStream.

bool WvDailyEvent::isok   const [virtual]
 

return true if the stream is actually usable right now

Reimplemented from WvStream.

Definition at line 81 of file wvdailyevent.cc.

virtual bool WvDailyEvent::post_select SelectInfo &    si [virtual]
 

post_select() is called after select(), and returns true if this object is now ready. Usually this is done by checking for this object in the read, write, and except lists in the SelectInfo structure. If you want to do it in some other way, you should usually do it in pre_select() instead. (post_select() _only_ gets called if select() returned true for _some_ stream or another.)

You may also want to do extra maintenance functions here; for example, the standard WvStream::post_select tries to flush outbuf if it's nonempty. WvTCPConn might retry connect() if it's waiting for a connection to be established.

Reimplemented from WvStream.

bool WvDailyEvent::post_select SelectInfo &    si [virtual]
 

post_select() is called after select(), and returns true if this object is now ready. Usually this is done by checking for this object in the read, write, and except lists in the SelectInfo structure. If you want to do it in some other way, you should usually do it in pre_select() instead. (post_select() _only_ gets called if select() returned true for _some_ stream or another.)

You may also want to do extra maintenance functions here; for example, the standard WvStream::post_select tries to flush outbuf if it's nonempty. WvTCPConn might retry connect() if it's waiting for a connection to be established.

Reimplemented from WvStream.

Definition at line 62 of file wvdailyevent.cc.

virtual bool WvDailyEvent::pre_select SelectInfo &    si [virtual]
 

pre_select() sets up for eventually calling select(). It adds the right fds to the read, write, and except lists in the SelectInfo struct.

Returns true if we already know this stream is ready, and there's no need to actually do a real select(). Some streams, such as timers, can be implemented by _only_ either returning true or false here after doing a calculation, and never actually adding anything to the SelectInfo.

You can add your stream to any of the lists even if readable, writable, or isexception isn't set. This is what force_select() does. You can also choose not to add yourself to the list if you know it would be useless right now.

pre_select() is only called if isok() is true.

pre_select() is allowed to reduce msec_timeout (or change it if it's -1). However, it's not allowed to _increase_ msec_timeout.

Reimplemented from WvStream.

bool WvDailyEvent::pre_select SelectInfo &    si [virtual]
 

pre_select() sets up for eventually calling select(). It adds the right fds to the read, write, and except lists in the SelectInfo struct.

Returns true if we already know this stream is ready, and there's no need to actually do a real select(). Some streams, such as timers, can be implemented by _only_ either returning true or false here after doing a calculation, and never actually adding anything to the SelectInfo.

You can add your stream to any of the lists even if readable, writable, or isexception isn't set. This is what force_select() does. You can also choose not to add yourself to the list if you know it would be useless right now.

pre_select() is only called if isok() is true.

pre_select() is allowed to reduce msec_timeout (or change it if it's -1). However, it's not allowed to _increase_ msec_timeout.

Reimplemented from WvStream.

Definition at line 27 of file wvdailyevent.cc.

void WvDailyEvent::reset  
 

void WvDailyEvent::reset  
 

Definition at line 75 of file wvdailyevent.cc.

void WvDailyEvent::set_hour int    h [inline]
 

Definition at line 37 of file streams/wvdailyevent.h.

References configure(), and num_per_day.

void WvDailyEvent::set_hour int    h [inline]
 

Definition at line 37 of file include/wvdailyevent.h.

References configure(), and num_per_day.


Member Data Documentation

int WvDailyEvent::first_hour [private]
 

Definition at line 41 of file streams/wvdailyevent.h.

int WvDailyEvent::last_hour [private]
 

Definition at line 44 of file streams/wvdailyevent.h.

int WvDailyEvent::last_minute [private]
 

Definition at line 45 of file streams/wvdailyevent.h.

bool WvDailyEvent::need_reset [private]
 

Definition at line 43 of file streams/wvdailyevent.h.

int WvDailyEvent::num_per_day [private]
 

Definition at line 42 of file streams/wvdailyevent.h.

Referenced by set_hour().


The documentation for this class was generated from the following files:
Generated on Sat Aug 24 21:37:04 2002 for WvStreams by doxygen1.2.15