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

WvStreamList Class Reference

#include <wvstreamlist.h>

Inheritance diagram for WvStreamList:

WvStream WvStreamListBase WvStream WvStreamListBase WvList< WvStream > WvList< WvStream > WvListBase WvListBase WvListBase WvListBase List of all members.

Public Methods

 WvStreamList ()
virtual ~WvStreamList ()
virtual bool isok () const
virtual bool pre_select (SelectInfo &si)
virtual bool post_select (SelectInfo &si)
virtual void execute ()
 WvStreamList ()
virtual ~WvStreamList ()
virtual bool isok () const
virtual bool pre_select (SelectInfo &si)
virtual bool post_select (SelectInfo &si)
virtual void execute ()

Public Attributes

bool auto_prune

Protected Attributes

WvStreamListBase sure_thing

Detailed Description

WvStreamList holds a list of WvStream objects -- and its select() and callback() functions know how to handle multiple simultaneous streams.

Definition at line 19 of file include/wvstreamlist.h.


Constructor & Destructor Documentation

WvStreamList::WvStreamList  
 

Definition at line 19 of file wvstreamlist.cc.

References auto_prune.

WvStreamList::~WvStreamList   [virtual]
 

Definition at line 25 of file wvstreamlist.cc.

WvStreamList::WvStreamList  
 

virtual WvStreamList::~WvStreamList   [virtual]
 


Member Function Documentation

virtual void WvStreamList::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 WvStreamList::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 108 of file wvstreamlist.cc.

References WvStream::callback(), WvListBase::count(), WvStream::execute(), sure_thing, TRACE, and WvList< WvStream >::zap().

virtual bool WvStreamList::isok   const [virtual]
 

return true if the stream is actually usable right now

Reimplemented from WvStream.

bool WvStreamList::isok   const [virtual]
 

return true if the stream is actually usable right now

Reimplemented from WvStream.

Definition at line 31 of file wvstreamlist.cc.

virtual bool WvStreamList::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 WvStreamList::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 82 of file wvstreamlist.cc.

References WvList< WvStream >::append(), WvStream::force, WvListBase::isempty(), WvStream::isok(), WvStream::post_select(), and sure_thing.

virtual bool WvStreamList::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 WvStreamList::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 37 of file wvstreamlist.cc.

References WvStream::alarm_remaining(), WvList< WvStream >::append(), WvStream::force, WvListBase::isempty(), WvStream::isok(), WvStream::pre_select(), sure_thing, and WvList< WvStream >::zap().


Member Data Documentation

bool WvStreamList::auto_prune
 

Definition at line 29 of file streams/wvstreamlist.h.

Referenced by WvStreamList().

WvStreamListBase WvStreamList::sure_thing [protected]
 

Definition at line 32 of file streams/wvstreamlist.h.

Referenced by execute(), post_select(), and pre_select().


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