00001 /* -*- Mode: C++ -*- 00002 * Worldvisions Weaver Software: 00003 * Copyright (C) 1997-2002 Net Integration Technologies, Inc. 00004 * 00005 * Provides support for managing a list of WvStreams. 00006 */ 00007 #ifndef __WVSTREAMLIST_H 00008 #define __WVSTREAMLIST_H 00009 00010 #include "wvstream.h" 00011 00012 /** Create the WvStreamListBase class - a simple linked list of WvStreams */ 00013 DeclareWvList2(WvStreamListBase, WvStream); 00014 00015 /** 00016 * WvStreamList holds a list of WvStream objects -- and its select() and 00017 * callback() functions know how to handle multiple simultaneous streams. 00018 */ 00019 class WvStreamList : public WvStream, public WvStreamListBase 00020 { 00021 public: 00022 WvStreamList(); 00023 virtual ~WvStreamList(); 00024 virtual bool isok() const; 00025 virtual bool pre_select(SelectInfo &si); 00026 virtual bool post_select(SelectInfo &si); 00027 virtual void execute(); 00028 00029 void unlink(WvStream *data) 00030 { sure_thing.unlink(data); WvStreamListBase::unlink(data); } 00031 00032 bool auto_prune; // remove !isok() streams from the list automatically? 00033 00034 protected: 00035 WvStreamListBase sure_thing; 00036 }; 00037 00038 #endif // __WVSTREAMLIST_H