Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

WvLogFileBase Class Reference

#include <wvlogfile.h>

Inherits WvLogRcv, and WvFile.

Inherited by WvLogFile.

Collaboration diagram for WvLogFileBase:

[legend]
List of all members.

Public Member Functions

 WvLogFileBase (WvStringParm _filename, WvLog::LogLevel _max_level=WvLog::NUM_LOGLEVELS)
void end_line ()
WvLog::LogLevel level () const
void level (WvLog::LogLevel lvl)
bool set_custom_levels (WvString descr)
bool open (WvStringParm filename, int mode, int create_mode=0666)
virtual bool pre_select (SelectInfo &si)
 pre_select() sets up for eventually calling ::select().

bool pre_select (SelectInfo &si, const SelectRequest &r)
 A more convenient version of pre_select() usable for overriding the 'want' value temporarily.

int getrfd () const
 Returns the Unix file descriptor for reading from this stream.

int getwfd () const
 Returns the Unix file descriptor for writing to this stream.

int getfd () const
 Returns the Unix file descriptor for reading and writing.

virtual void close ()
 Closes the file descriptors.

virtual bool isok () const
 return true if the stream is actually usable right now

virtual size_t uread (void *buf, size_t count)
 unbuffered I/O functions; these ignore the buffer, which is handled by read().

virtual size_t uwrite (const void *buf, size_t count)
 unbuffered I/O functions; these ignore the buffer, which is handled by write().

virtual bool post_select (SelectInfo &si)
 post_select() is called after ::select(), and returns true if this object is now ready.

bool post_select (SelectInfo &si, const SelectRequest &r)
 A more convenient version of post_select() usable for overriding the 'want' value temporarily.

virtual void noread ()
 Shuts down the reading side of the stream.

virtual void nowrite ()
 Shuts down the writing side of the stream.

virtual void seterr (int _errnum)
 Override seterr() from WvError so that it auto-closes the stream.

void seterr (WvStringParm specialerr)
void seterr (WVSTRING_FORMAT_DECL)
void seterr (const WvError &err)
virtual size_t read (void *buf, size_t count)
 read a data block on the stream.

virtual size_t read (WvBuf &outbuf, size_t count)
 Reads up to 'count' bytes of data from the stream into the buffer.

virtual size_t continue_read (time_t wait_msec, void *buf, size_t count)
 Read exactly count bytes from the stream.

virtual size_t continue_read (time_t wait_msec, WvBuf &outbuf, size_t count)
 Read exactly count bytes from the stream, using continue_select().

virtual void unread (WvBuf &outbuf, size_t count)
 Puts data back into the stream's internal buffer.

virtual size_t write (const void *buf, size_t count)
 Write data to the stream.

virtual size_t write (WvBuf &inbuf, size_t count=INT_MAX)
 Writes data to the stream from the given buffer.

size_t write (WvStringParm s)
 print a preformatted WvString to the stream.

void outbuf_limit (size_t size)
 set the maximum size of outbuf, beyond which a call to write() will return 0.

virtual bool isreadable ()
 Returns true if the stream is readable.

virtual bool iswritable ()
 Returns true if the stream is writable (without using the outbuf).

char * getline (time_t wait_msec, char separator= '\n', int readahead=1024)
 read up to one line of data from the stream and return a pointer to the internal buffer containing this line.

void queuemin (size_t count)
 force read() to not return any bytes unless 'count' bytes can be read at once.

void drain ()
 drain the input buffer (read and discard data until select(0) returns false)

void delay_output (bool is_delayed)
 force write() to always buffer output.

void auto_flush (bool is_automatic)
 if true, force write() to call flush() each time, the default behavour.

virtual bool flush (time_t msec_timeout)
 flush the output buffer, if we can do it without delaying more than msec_timeout milliseconds at a time.

virtual bool should_flush ()
 Returns true if we want to flush the output buffer right now.

void flush_then_close (int msec_timeout)
 flush the output buffer automatically as select() is called.

bool xpre_select (SelectInfo &si, const SelectRequest &r)
 Like pre_select(), but still exists even if you override the other pre_select() in a subclass.

bool xpost_select (SelectInfo &si, const SelectRequest &r)
 Like post_select(), but still exists even if you override the other post_select() in a subclass.

bool select (time_t msec_timeout)
 Return true if any of the requested features are true on the stream.

bool select (time_t msec_timeout, bool readable, bool writable, bool isex=false)
 This version of select() sets forceable==false, so we use the exact readable/writable/isexception options provided.

void runonce (time_t msec_timeout=-1)
 Exactly the same as: if (select(timeout)) callback();.

void force_select (bool readable, bool writable, bool isexception=false)
 Use force_select() to force one or more particular modes (readable, writable, or isexception) to true when selecting on this stream.

void undo_force_select (bool readable, bool writable, bool isexception=false)
 Undo a previous force_select() - ie.

bool continue_select (time_t msec_timeout)
 return to the caller from execute(), but don't really return exactly; this uses WvTaskMan::yield() to return to the caller of callback() without losing our place in execute() itself.

void terminate_continue_select ()
 you MUST run this from your destructor if you use continue_select(), or very weird things will happen if someone deletes your object while in continue_select().

virtual const WvAddrsrc () const
 get the remote address from which the last data block was received.

void setcallback (WvStreamCallback _callfunc, void *_userdata)
 define the callback function for this stream, called whenever the callback() member is run, and passed the 'userdata' pointer.

void setclosecallback (WvStreamCallback _callfunc, void *_userdata)
 Sets a callback to be invoked on close().

void autoforward (WvStream &s)
 set the callback function for this stream to an internal routine that auto-forwards all incoming stream data to the given output stream.

void noautoforward ()
 Stops autoforwarding.

virtual void callback ()
 if the stream has a callback function defined, call it now.

void alarm (time_t msec_timeout)
 set an alarm, ie.

time_t alarm_remaining ()
 return the number of milliseconds remaining before the alarm will go off; -1 means no alarm is set (infinity), 0 means the alarm has been hit and will be cleared by the next callback().

size_t print (WvStringParm s)
size_t print (WVSTRING_FORMAT_DECL)
 preformat and write() a string.

size_t operator() (WvStringParm s)
size_t operator() (WVSTRING_FORMAT_DECL)
virtual unsigned int addRef ()
virtual unsigned int release ()
virtual int geterr () const
 If isok() is false, return the system error number corresponding to the error, -1 for a special error string (which you can obtain with errstr()) or 0 on end of file.

virtual WvString errstr () const
void noerr ()
 Reset our error state - there's no error condition anymore.


Static Public Member Functions

void autoforward_callback (WvStream &s, void *userdata)

Public Attributes

bool readable
bool writable
bool skip_select
SelectRequest force
 'force' is the list of default SelectRequest values when you use the variant of select() that doesn't override them.

WvStreamread_requires_writable
 If this is set, select() doesn't return true for read unless the given stream also returns true for write.

WvStreamwrite_requires_readable
 If this is set, select() doesn't return true for write unless the given stream also returns true for read.

bool uses_continue_select
 If this is set, enables the use of continue_select().

size_t personal_stack_size
 Specifies the stack size to reserve for continue_select().

bool alarm_was_ticking
 This will be true during callback execution if the callback was triggered by the alarm going off.


Static Public Attributes

char * loglevels [WvLog::NUM_LOGLEVELS]
const XUUID XIID

Protected Member Functions

 WvLogFileBase (WvLog::LogLevel _max_level)
virtual void _make_prefix ()
 Set the Prefix and Prefix Length (size_t prelen).

virtual void _mid_line (const char *str, size_t len)
 add text to the current log line.

 DeclareWvDict (Src_Lvl, WvString, src)
virtual void log (const WvLog *source, int loglevel, const char *_buf, size_t len)
virtual void _begin_line ()
 Start a new log line (print prefix).

virtual void _end_line ()
 End this (Guaranteed NonEmpty) log line.

const char * appname (const WvLog *log) const
void setfd (int fd)
 Sets the file descriptor for both reading and writing.

bool _build_selectinfo (SelectInfo &si, time_t msec_timeout, bool readable, bool writable, bool isexcept, bool forceable)
int _do_select (SelectInfo &si)
bool _process_selectinfo (SelectInfo &si, bool forceable)
bool flush_outbuf (time_t msec_timeout)
virtual bool flush_internal (time_t msec_timeout)
virtual void execute ()
 The callback() function calls execute(), and then calls the user- specified callback if one is defined.


Static Protected Member Functions

void _callback (void *stream)
 actually do the callback for an arbitrary stream.


Protected Attributes

const WvLoglast_source
WvLog::LogLevel max_level
WvLog::LogLevel last_level
bool at_newline
WvString prefix
size_t prelen
Src_LvlDict custom_levels
int rfd
 The file descriptor for reading.

int wfd
 The file descriptor for writing.

WvTaskMantaskman
WvDynBuf inbuf
WvDynBuf outbuf
WvStreamCallback callfunc
WvStreamCallback closecb_func
void * userdata
void * closecb_data
size_t max_outbuf_size
bool outbuf_delayed_flush
bool is_auto_flush
bool want_nowrite
bool want_to_flush
bool is_flushing
size_t queue_min
time_t autoclose_time
WvTime alarm_time
WvTime last_alarm_check
bool running_callback
bool wvstream_execute_called
WvTasktask
int errnum
WvString errstring

Static Protected Attributes

WvStreamglobalstream = NULL

Constructor & Destructor Documentation

WvLogFileBase::WvLogFileBase WvStringParm  _filename,
WvLog::LogLevel  _max_level = WvLog::NUM_LOGLEVELS
[inline]
 

Definition at line 21 of file wvlogfile.h.

References WvStringParm.

WvLogFileBase::WvLogFileBase WvLog::LogLevel  _max_level  )  [inline, protected]
 

Definition at line 26 of file wvlogfile.h.


Member Function Documentation

void WvLogRcv::_begin_line  )  [protected, virtual, inherited]
 

Start a new log line (print prefix).

Reimplemented in WvLogBuffer, and WvSyslog.

Definition at line 173 of file wvlog.cc.

References WvLogRcv::prefix, and WvLogRcv::prelen.

bool WvStream::_build_selectinfo SelectInfo &  si,
time_t  msec_timeout,
bool  readable,
bool  writable,
bool  isexcept,
bool  forceable
[protected, inherited]
 

Definition at line 699 of file wvstream.cc.

References WvStream::_build_selectinfo(), WvStream::force, WvStream::globalstream, WvStream::isok(), and WvStream::pre_select().

Referenced by WvStream::_build_selectinfo().

void WvStream::_callback void *  stream  )  [static, protected, inherited]
 

actually do the callback for an arbitrary stream.

This is a static function so we can pass it as a function pointer to WvTask functions.

Definition at line 156 of file wvstream.cc.

References WvStream::_callback(), WvStream::callfunc, WvStream::execute(), WvStream::running_callback, WvStream::userdata, and WvStream::wvstream_execute_called.

Referenced by WvStream::_callback(), and WvStream::callback().

int WvStream::_do_select SelectInfo &  si  )  [protected, inherited]
 

Definition at line 736 of file wvstream.cc.

References WvStream::_do_select(), and WvStream::seterr().

Referenced by WvStream::_do_select().

void WvLogRcv::_end_line  )  [protected, virtual, inherited]
 

End this (Guaranteed NonEmpty) log line.

Reimplemented in WvLogBuffer, and WvSyslog.

Definition at line 179 of file wvlog.cc.

Referenced by WvLogRcv::end_line().

void WvLogFileBase::_make_prefix  )  [protected, virtual]
 

Set the Prefix and Prefix Length (size_t prelen).

Reimplemented from WvLogRcv.

Definition at line 24 of file wvlogfile.cc.

References WvFastString::len(), and wvtime().

void WvLogFileBase::_mid_line const char *  str,
size_t  len
[protected, virtual]
 

add text to the current log line.

'str' may contain only one '
' optional character at str[len-1] (the end); if it does, end_line will be called immediately after this function.

Implements WvLogRcv.

Definition at line 19 of file wvlogfile.cc.

References _mid_line().

Referenced by _mid_line().

bool WvStream::_process_selectinfo SelectInfo &  si,
bool  forceable
[protected, inherited]
 

Definition at line 767 of file wvstream.cc.

References WvStream::_process_selectinfo(), WvStream::globalstream, WvStream::isok(), and WvStream::post_select().

Referenced by WvStream::_process_selectinfo().

virtual unsigned int GenericComponent< IWvStream >::addRef  )  [inline, virtual, inherited]
 

Implements IObject.

Definition at line 67 of file wvxplc.h.

void WvStream::alarm time_t  msec_timeout  )  [inherited]
 

set an alarm, ie.

select() will return true after this many ms. The alarm is cleared when callback() is called.

Definition at line 826 of file wvstream.cc.

References WvStream::alarm(), WvStream::alarm_time, msecadd(), and wvtime().

Referenced by WvStream::alarm(), UniClientGen::clientdelta(), WvStream::continue_read(), WvStream::continue_select(), UniClientGen::do_select(), itertest3(), WvDelayedCallback< InnerCallback >::operator()(), and runtests().

time_t WvStream::alarm_remaining  )  [inherited]
 

return the number of milliseconds remaining before the alarm will go off; -1 means no alarm is set (infinity), 0 means the alarm has been hit and will be cleared by the next callback().

Definition at line 835 of file wvstream.cc.

References WvStream::alarm_time, WvStream::last_alarm_check, msecdiff(), WvStream::running_callback, tvdiff(), wvtime(), and WvTime.

Referenced by WvStream::callback(), WvStreamList::pre_select(), WvStream::pre_select(), and WvIStreamList::pre_select().

const char * WvLogRcvBase::appname const WvLog log  )  const [protected, inherited]
 

Definition at line 140 of file wvlog.cc.

References WvLog::app, WvLogRcvBase::appname(), and log.

Referenced by WvLogRcvBase::appname().

void WvStream::auto_flush bool  is_automatic  )  [inline, inherited]
 

if true, force write() to call flush() each time, the default behavour.

otherwise, flush() is granted special meaning when explicitly invoked by the client and write() may empty the output buffer, but will not explicitly flush().

Definition at line 358 of file wvstream.h.

void WvStream::autoforward WvStream s  )  [inherited]
 

set the callback function for this stream to an internal routine that auto-forwards all incoming stream data to the given output stream.

Definition at line 128 of file wvstream.cc.

References WvStream::autoforward(), WvStream::autoforward_callback(), WvStream::read_requires_writable, and WvStream::setcallback().

Referenced by WvStream::autoforward(), fcopy(), and main().

void WvStream::autoforward_callback WvStream s,
void *  userdata
[static, inherited]
 

Definition at line 142 of file wvstream.cc.

References WvStream::autoforward_callback(), WvStream::read(), and WvStream::write().

Referenced by WvStream::autoforward(), and WvStream::autoforward_callback().

void WvStream::callback  )  [virtual, inherited]
 

if the stream has a callback function defined, call it now.

otherwise call execute().

Implements IWvStream.

Definition at line 178 of file wvstream.cc.

References WvStream::_callback(), WvStream::alarm_remaining(), WvStream::alarm_time, WvStream::alarm_was_ticking, WvTaskMan::get(), WvTask::isrunning(), WvStream::personal_stack_size, WvTaskMan::run(), WvStream::running_callback, WvTask::start(), WvTaskMan::start(), WvStream::task, WvStream::taskman, TRACE, and WvStream::uses_continue_select.

Referenced by UniClientGen::do_select(), WvStreamList::execute(), fcopy(), main(), and runtests().

void WvFDStream::close  )  [virtual, inherited]
 

Closes the file descriptors.

If it is undesirable for the file descriptors to be closed by this stream, duplicate the file descriptors using dup() before creating the stream.

Reimplemented from WvStream.

Reimplemented in WvModemBase, WvModem, WvTCPListener, and WvUnixListener.

Definition at line 67 of file wvfdstream.cc.

References WvStream::close(), WvFDStream::rfd, and WvFDStream::wfd.

Referenced by WvUnixListener::close(), WvTCPListener::close(), WvModem::close(), WvDsp::close(), UniIniGen::commit(), WvFtpStream::execute(), WvPipe::finish(), WvConf::load_file(), WvLockDev::lock(), WvFileWatcher::make_ok(), WvFile::open(), UniIniGen::refresh(), WvFileWatcher::WvFileWatcher(), WvFDStream::~WvFDStream(), WvPipe::~WvPipe(), and WvUnixConn::~WvUnixConn().

size_t WvStream::continue_read time_t  wait_msec,
WvBuf outbuf,
size_t  count
[virtual, inherited]
 

Read exactly count bytes from the stream, using continue_select().

Definition at line 298 of file wvstream.cc.

References WvBufBaseCommonImpl< unsigned char >::alloc(), WvStream::continue_read(), WvBufBaseCommonImpl< unsigned char >::free(), and WvBufBaseCommonImpl< unsigned char >::unalloc().

size_t WvStream::continue_read time_t  wait_msec,
void *  buf,
size_t  count
[virtual, inherited]
 

Read exactly count bytes from the stream.

Notes: must be using continue_select to use this function. if timeout strikes or !isok() before count bytes could be read, nothing is read and 0 is returned. resets queuemin to 0.

FIXME: yes, that means if the stream closes, continue_read might not read the last bit of data. You can use read() for that if you want.

Definition at line 362 of file wvstream.cc.

References WvStream::alarm(), WvStream::alarm_was_ticking, WvStream::continue_read(), WvStream::continue_select(), WvStream::isok(), WvStream::queuemin(), WvStream::read(), and WvStream::uses_continue_select.

Referenced by WvStream::continue_read().

bool WvStream::continue_select time_t  msec_timeout  )  [inherited]
 

return to the caller from execute(), but don't really return exactly; this uses WvTaskMan::yield() to return to the caller of callback() without losing our place in execute() itself.

So, next time someone calls callback(), it will be as if continue_select() returned.

NOTE: execute() will won't be called recursively this way, but any other member function might get called, or member variables changed, or the state of the world updated while continue_select() runs. Don't assume that nothing has changed after a call to continue_select().

NOTE 2: if you're going to call continue_select(), you should set uses_continue_select=true before the first call to callback(). Otherwise your WvTask struct won't get created.

NOTE 3: if msec_timeout >= 0, this uses WvStream::alarm().

Definition at line 856 of file wvstream.cc.

References WvStream::alarm(), WvStream::alarm_was_ticking, WvStream::continue_select(), WvStream::running_callback, WvStream::select(), WvStream::task, WvStream::taskman, TRACE, WvStream::uses_continue_select, WvTaskMan::whoami(), and WvTaskMan::yield().

Referenced by WvStream::continue_read(), WvStream::continue_select(), and WvStream::getline().

WvLogRcv::DeclareWvDict Src_Lvl  ,
WvString  ,
src 
[protected, inherited]
 

void WvStream::delay_output bool  is_delayed  )  [inline, inherited]
 

force write() to always buffer output.

This can be more efficient if you write a lot of small segments and want to "coagulate" them automatically. To flush the output buffer, use flush() or select().

Definition at line 346 of file wvstream.h.

void WvStream::drain  )  [inherited]
 

drain the input buffer (read and discard data until select(0) returns false)

Definition at line 541 of file wvstream.cc.

References WvStream::isreadable(), and WvStream::read().

Referenced by WvModemBase::hangup(), and WvDsp::pre_select().

void WvLogRcv::end_line  )  [inline, inherited]
 

Definition at line 82 of file wvlogrcv.h.

References WvLogRcv::_end_line(), and WvLogRcv::at_newline.

Referenced by WvLogRcv::log(), WvLogBuffer::messages(), WvLogBuffer::~WvLogBuffer(), WvLogConsole::~WvLogConsole(), and WvSyslog::~WvSyslog().

WvString WvError::errstr  )  const [virtual, inherited]
 

Reimplemented in WvHTTPStream, and WvStreamClone.

Definition at line 20 of file wverror.cc.

References WvError::errnum, and WvError::errstring.

Referenced by UniIniGen::commit(), WvStreamClone::errstr(), main(), UniIniGen::refresh(), WvError::seterr(), UniConfDaemon::setupsslsocket(), UniConfDaemon::setuptcpsocket(), UniConfDaemon::setupunixsocket(), WvX509Mgr::WvX509Mgr(), and WvHttpPool::~WvHttpPool().

void WvStream::execute  )  [protected, virtual, inherited]
 

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 in WvDailyEvent, WvUrlStream, WvHttpStream, WvFtpStream, WvHttpPool, WvIStreamList, WvProtoStream, WvStreamClone, WvStreamList, WvTimeoutStream, WvTimeStream, UniConfDaemonConn, and MySocket.

Definition at line 259 of file wvstream.cc.

References WvStream::wvstream_execute_called.

Referenced by WvStream::_callback(), WvTimeStream::execute(), WvTimeoutStream::execute(), WvStreamList::execute(), WvStreamClone::execute(), WvIStreamList::execute(), and WvDailyEvent::execute().

bool WvStream::flush time_t  msec_timeout  )  [virtual, inherited]
 

flush the output buffer, if we can do it without delaying more than msec_timeout milliseconds at a time.

(-1 means wait forever)

Returns true if the flushing finished (the output buffer is empty).

Implements IWvStream.

Definition at line 549 of file wvstream.cc.

References WvStream::flush(), WvStream::flush_internal(), WvStream::flush_outbuf(), WvStream::is_flushing, TRACE, and WvStream::want_to_flush.

Referenced by WvStream::close(), WvStream::flush(), WvStream::flush_then_close(), and WvStream::write().

bool WvStream::flush_internal time_t  msec_timeout  )  [protected, virtual, inherited]
 

Reimplemented in WvEncoderStream, and WvStreamClone.

Definition at line 634 of file wvstream.cc.

References WvStream::flush_internal().

Referenced by WvStream::flush(), WvStream::flush_internal(), and WvStream::flush_outbuf().

bool WvStream::flush_outbuf time_t  msec_timeout  )  [protected, inherited]
 

Definition at line 572 of file wvstream.cc.

References WvStream::autoclose_time, WvStream::close(), WvStream::flush_internal(), WvStream::flush_outbuf(), WvBufBaseCommonImpl< T >::get(), WvStream::isok(), WvStream::outbuf, WvStream::outbuf_delayed_flush, WvStream::select(), TRACE, WvBufBaseCommonImpl< T >::unget(), WvBufBaseCommonImpl< T >::ungettable(), WvBufBaseCommonImpl< T >::used(), WvStream::uwrite(), WvStream::want_to_flush, and WvBufBaseCommonImpl< T >::zap().

Referenced by WvStream::flush(), WvStream::flush_outbuf(), and WvStream::write().

void WvStream::flush_then_close int  msec_timeout  )  [inherited]
 

flush the output buffer automatically as select() is called.

If the buffer empties, close the stream. If msec_timeout seconds pass, close the stream. After the stream closes, it will become !isok() (and a WvStreamList can delete it automatically)

Definition at line 653 of file wvstream.cc.

References WvStream::autoclose_time, WvStream::flush(), WvStream::flush_then_close(), WvStream::outbuf, TRACE, and WvBufBaseCommonImpl< T >::used().

Referenced by WvStream::flush_then_close(), and main().

void WvStream::force_select bool  readable,
bool  writable,
bool  isexception = false
[inherited]
 

Use force_select() to force one or more particular modes (readable, writable, or isexception) to true when selecting on this stream.

If an option is set 'true', we will select on that option when someone does a select(). If it's set 'false', we don't change its force status. (To de-force something, use undo_force_select().)

Definition at line 810 of file wvstream.cc.

References WvStream::force, and WvStream::force_select().

Referenced by WvStream::force_select().

virtual int WvError::geterr  )  const [inline, virtual, inherited]
 

If isok() is false, return the system error number corresponding to the error, -1 for a special error string (which you can obtain with errstr()) or 0 on end of file.

If isok() is true, returns an undefined number.

Reimplemented in WvHTTPStream, and WvStreamClone.

Definition at line 44 of file wverror.h.

References WvError::errnum.

Referenced by UniIniGen::commit(), WvStreamClone::geterr(), WvEncoderStream::isok(), WvConf::load_file(), WvLockDev::lock(), main(), WvHTTPStream::pre_select(), UniIniGen::refresh(), WvConf::save(), WvError::seterr(), WvMagicCircle::WvMagicCircle(), and WvHttpPool::~WvHttpPool().

int WvFDStream::getfd  )  const [inline, inherited]
 

Returns the Unix file descriptor for reading and writing.

Asserts that the file descriptors for reading and writing are the same before returning.

Returns: the file descriptor, or -1 if none

Definition at line 78 of file wvfdstream.h.

References WvFDStream::rfd, and WvFDStream::wfd.

Referenced by WvUnixListener::accept(), WvTCPListener::accept(), WvTCPConn::debug_mode(), WvTCPConn::do_connect(), WvUDPStream::enable_broadcasts(), WvIPRawStream::enable_broadcasts(), WvTCPConn::localaddr(), WvTCPConn::low_delay(), WvTCPConn::nice_tcpopts(), WvTCPConn::post_select(), WvSSLStream::post_select(), WvUDPStream::uread(), WvIPRawStream::uread(), WvUDPStream::uwrite(), WvIPRawStream::uwrite(), WvIPRawStream::WvIPRawStream(), WvTCPListener::WvTCPListener(), WvUDPStream::WvUDPStream(), WvUnixConn::WvUnixConn(), and WvUnixListener::WvUnixListener().

char * WvStream::getline time_t  wait_msec,
char  separator = '\n',
int  readahead = 1024
[inherited]
 

read up to one line of data from the stream and return a pointer to the internal buffer containing this line.

If the end-of-line 'separator' is encountered, it is removed from the string. If wait_msec times out before the end of line is found, returns NULL and the line may be returned next time, or you can read what we have so far by calling read().

If wait_msec < 0, waits forever for a newline (often a bad idea!) If wait_msec=0, never waits. Otherwise, waits up to wait_msec milliseconds until a newline appears.

Readahead specifies the maximum amount of data that the stream is allowed to read in one shot.

It is expected that there will be no NULL characters on the line.

If uses_continue_select is true, getline() will use continue_select() rather than select() to wait for its timeout.

Definition at line 460 of file wvstream.cc.

References WvBufBaseCommonImpl< T >::alloc(), WvStream::continue_select(), WvBufBaseCommonImpl< T >::get(), WvStream::getline(), WvStream::inbuf, WvStream::isok(), msecadd(), msecdiff(), WvBufBaseCommonImpl< T >::mutablepeek(), WvBufBaseCommonImpl< T >::put(), WvStream::queuemin(), WvStream::select(), WvBufBaseCommonImpl< T >::unalloc(), WvStream::uread(), WvBufBaseCommonImpl< T >::used(), WvStream::uses_continue_select, and wvtime().

Referenced by concallback(), WvFtpStream::execute(), WvIPRouteList::get_kernel(), WvStream::getline(), WvConf::load_file(), WvLockDev::lock(), main(), mycallback(), WvLockFile::readpid(), UniIniGen::refresh(), WvInterfaceDict::update(), and WvHTTPStream::uread().

int WvFDStream::getrfd  )  const [inline, virtual, inherited]
 

Returns the Unix file descriptor for reading from this stream.

Returns: the file descriptor, or -1 if none

Reimplemented from WvStream.

Definition at line 60 of file wvfdstream.h.

References WvFDStream::rfd.

Referenced by WvModem::close(), WvModemBase::get_real_speed(), WvModemBase::hangup(), WvConf::load_file(), WvFileWatcher::make_ok(), WvFileWatcher::pre_select(), WvModem::speed(), and WvPipe::WvPipe().

int WvFDStream::getwfd  )  const [inline, virtual, inherited]
 

Returns the Unix file descriptor for writing to this stream.

Returns: the file descriptor, or -1 if none

Reimplemented from WvStream.

Definition at line 67 of file wvfdstream.h.

References WvFDStream::wfd.

Referenced by WvPipe::finish(), WvConf::save(), and WvPipe::WvPipe().

bool WvFDStream::isok  )  const [virtual, inherited]
 

return true if the stream is actually usable right now

Reimplemented from WvStream.

Reimplemented in WvTCPConn, and WvFileWatcher.

Definition at line 79 of file wvfdstream.cc.

References WvStream::isok(), WvFDStream::rfd, and WvFDStream::wfd.

Referenced by WvConf::addfile(), WvModem::close(), UniIniGen::commit(), do_addfile(), WvUDPStream::enable_broadcasts(), WvIPRawStream::enable_broadcasts(), fcopy(), WvIPRouteList::get_kernel(), WvModemBase::get_real_speed(), WvModemBase::hangup(), WvTCPConn::isok(), WvConf::load_file(), WvLockFile::lock(), WvLockDev::lock(), main(), WvFileWatcher::make_ok(), WvFDStream::post_select(), UniIniGen::refresh(), WvConf::save(), UniConfDaemon::setupsslsocket(), UniConfDaemon::setuptcpsocket(), UniConfDaemon::setupunixsocket(), WvUDPStream::uread(), WvIPRawStream::uread(), WvFDStream::uread(), WvUDPStream::uwrite(), WvIPRawStream::uwrite(), WvFDStream::uwrite(), WvFileWatcher::WvFileWatcher(), and WvModem::WvModem().

bool WvStream::isreadable  )  [virtual, inherited]
 

Returns true if the stream is readable.

Implements IWvStream.

Definition at line 448 of file wvstream.cc.

References WvStream::isok(), and WvStream::select().

Referenced by WvStream::drain().

bool WvStream::iswritable  )  [virtual, inherited]
 

Returns true if the stream is writable (without using the outbuf).

Implements IWvStream.

Definition at line 454 of file wvstream.cc.

References WvStream::isok(), and WvStream::select().

void WvLogRcv::level WvLog::LogLevel  lvl  )  [inline, inherited]
 

Definition at line 88 of file wvlogrcv.h.

References WvLogRcv::max_level.

WvLog::LogLevel WvLogRcv::level  )  const [inline, inherited]
 

Definition at line 86 of file wvlogrcv.h.

References WvLogRcv::max_level.

Referenced by main().

void WvLogRcv::log const WvLog source,
int  loglevel,
const char *  _buf,
size_t  len
[protected, virtual, inherited]
 

Implements WvLogRcvBase.

Definition at line 197 of file wvlog.cc.

References WvLogRcv::_make_prefix(), WvLog::app, WvLogRcv::custom_levels, WvString::edit(), WvLogRcv::end_line(), WvLogRcv::last_level, WvLogRcv::last_source, WvLogRcv::max_level, my_isprint(), and strlwr().

void WvStream::noautoforward  )  [inherited]
 

Stops autoforwarding.

Definition at line 135 of file wvstream.cc.

References WvStream::read_requires_writable, and WvStream::setcallback().

void WvError::noerr  )  [inline, inherited]
 

Reset our error state - there's no error condition anymore.

Definition at line 65 of file wverror.h.

References WvError::errnum.

Referenced by WvError::WvError().

void WvFDStream::noread  )  [virtual, inherited]
 

Shuts down the reading side of the stream.

Subsequent calls to read() will fail.

Reimplemented from WvStream.

Definition at line 137 of file wvfdstream.cc.

References WvFDStream::rfd, and WvFDStream::wfd.

Referenced by WvDsp::WvDsp().

void WvFDStream::nowrite  )  [virtual, inherited]
 

Shuts down the writing side of the stream.

Subsequent calls to write() will fail.

Reimplemented from WvStream.

Definition at line 149 of file wvfdstream.cc.

References WvStream::nowrite(), WvFDStream::rfd, WvBufBaseCommonImpl< T >::used(), and WvFDStream::wfd.

Referenced by WvDsp::WvDsp().

bool WvFile::open WvStringParm  filename,
int  mode,
int  create_mode = 0666
[inherited]
 

Definition at line 39 of file wvfile.cc.

References WvFDStream::close(), WvFile::open(), WvFile::readable, WvFile::skip_select, WvFile::writable, and WvStringParm.

Referenced by WvLockDev::lock(), WvFile::open(), and WvFile::WvFile().

size_t WvStream::operator() WVSTRING_FORMAT_DECL   )  [inline, inherited]
 

Reimplemented in WvLog.

Definition at line 624 of file wvstream.h.

References WVSTRING_FORMAT_CALL.

size_t WvStream::operator() WvStringParm  s  )  [inline, inherited]
 

Reimplemented in WvLog.

Definition at line 618 of file wvstream.h.

void WvStream::outbuf_limit size_t  size  )  [inline, inherited]
 

set the maximum size of outbuf, beyond which a call to write() will return 0.

I need to do this for tape backups, since all I can do is write to the loopback as fast as I can, which causes us to run out of memory and get SIGABRT'd. (dcoombs: 12/15/2000)

FIXME: there must be a better way. This confuses the semantics of write(); can you trust it to always write all the bytes, or not?

Definition at line 273 of file wvstream.h.

bool WvStream::post_select SelectInfo &  si,
const SelectRequest &  r
[inline, inherited]
 

A more convenient version of post_select() usable for overriding the 'want' value temporarily.

Definition at line 447 of file wvstream.h.

bool WvFDStream::post_select SelectInfo &  si  )  [virtual, inherited]
 

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.

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.

Reimplemented in WvTCPConn.

Definition at line 194 of file wvfdstream.cc.

References WvFDStream::isok(), WvFDStream::post_select(), WvFDStream::rfd, WvStream::select(), WvStream::should_flush(), WvBufBaseCommonImpl< T >::used(), and WvFDStream::wfd.

Referenced by WvFDStream::post_select(), and WvDsp::post_select().

bool WvStream::pre_select SelectInfo &  si,
const SelectRequest &  r
[inline, inherited]
 

A more convenient version of pre_select() usable for overriding the 'want' value temporarily.

Definition at line 406 of file wvstream.h.

bool WvFile::pre_select SelectInfo &  si  )  [virtual, inherited]
 

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 WvFDStream.

Reimplemented in WvFileWatcher.

Definition at line 74 of file wvfile.cc.

References WvFile::pre_select(), WvFile::readable, WvFile::skip_select, and WvFile::writable.

Referenced by WvFile::pre_select().

size_t WvStream::print WVSTRING_FORMAT_DECL   )  [inline, inherited]
 

preformat and write() a string.

Definition at line 622 of file wvstream.h.

References WVSTRING_FORMAT_CALL.

size_t WvStream::print WvStringParm  s  )  [inline, inherited]
 

Definition at line 616 of file wvstream.h.

Referenced by WvConf::addfile(), cmptest(), concallback(), do_addfile(), WvLogBuffer::dump(), WvConfigSection::dump(), WvLockFile::lock(), WvLockDev::lock(), main(), mycallback(), namelookup(), WvLog::operator()(), printkey(), printsection(), runtests(), WvConf::save(), test(), trymount(), and usage().

void WvStream::queuemin size_t  count  )  [inline, inherited]
 

force read() to not return any bytes unless 'count' bytes can be read at once.

(Useful for processing Content-Length headers, etc.) Use count==0 to disable this feature.

WARNING: getline() sets queuemin to 0 automatically!

Definition at line 332 of file wvstream.h.

Referenced by WvStream::continue_read(), and WvStream::getline().

size_t WvStream::read WvBuf outbuf,
size_t  count
[virtual, inherited]
 

Reads up to 'count' bytes of data from the stream into the buffer.

Returns the actual amount read.

If 'count' is greater than the amount of free space available in the buffer, only reads at most that amount. You should specify a reasonable upper bound on how much data should be read at once.

Implements IWvStream.

Definition at line 282 of file wvstream.cc.

References WvBufBaseCommonImpl< T >::alloc(), WvBufBaseCommonImpl< unsigned char >::free(), WvBufBaseCommonImpl< unsigned char >::merge(), WvStream::read(), WvBufBaseCommonImpl< T >::unalloc(), and WvBuf.

size_t WvStream::read void *  buf,
size_t  count
[virtual, inherited]
 

read a data block on the stream.

Returns the actual amount read.

Implements IWvStream.

Definition at line 327 of file wvstream.cc.

References WvBufBaseCommonImpl< T >::alloc(), WvBufBaseCommonImpl< T >::get(), WvStream::inbuf, WvStream::queue_min, WvStream::read(), TRACE, WvBufBaseCommonImpl< T >::unalloc(), WvStream::uread(), and WvBufBaseCommonImpl< T >::used().

Referenced by WvStream::autoforward_callback(), WvStream::continue_read(), WvStream::drain(), WvHttpStream::execute(), WvFtpStream::execute(), WvPipe::ignore_read(), main(), WvStream::read(), and WvHTTPStream::uread().

virtual unsigned int GenericComponent< IWvStream >::release  )  [inline, virtual, inherited]
 

Implements IObject.

Definition at line 70 of file wvxplc.h.

void WvStream::runonce time_t  msec_timeout = -1  )  [inline, inherited]
 

Exactly the same as: if (select(timeout)) callback();.

...except that the above is deprecated, because it assumes callbacks aren't called automatically and that the return value of one-parameter select() is actually meaningful.

Update your main loop to call runonce() instead of the above.

Almost all modern programs should use msec_timeout = -1.

Definition at line 492 of file wvstream.h.

References IWvStream::callback().

bool WvStream::select time_t  msec_timeout,
bool  readable,
bool  writable,
bool  isex = false
[inline, inherited]
 

This version of select() sets forceable==false, so we use the exact readable/writable/isexception options provided.

You normally use this variant of select() when deciding whether you should read/write a particular stream. For example:

if (stream.select(1000, true, false)) len = stream.read(buf, sizeof(buf));

This variant of select() is probably not what you want with most WvStreamLists, unless you know exactly what you're doing.

WARNING: the difference between the one-parameter and multi-parameter versions of select() is *incredibly* confusing. Make sure you use the right one!

DEPRECATED. Call isreadable() or iswritable() instead, if msec_timeout was going to be zero. Other values of msec_timeout are not really recommended anyway.

Definition at line 516 of file wvstream.h.

bool WvStream::select time_t  msec_timeout  )  [inline, inherited]
 

Return true if any of the requested features are true on the stream.

If msec_timeout < 0, waits forever (bad idea!). ==0, does not wait. Otherwise, waits for up to msec_timeout milliseconds.

**NOTE** select() is _not_ virtual! To change the select() behaviour of a stream, override the pre_select() and/or post_select() functions.

This version of select() sets forceable==true, so force_select options are taken into account.

You almost always use this version of select() with callbacks, like this: if (stream.select(1000)) stream.callback();

If you want to read/write the stream in question, try using the other variant of select().

DEPRECATED. Call runonce() instead.

Definition at line 477 of file wvstream.h.

Referenced by WvStream::continue_select(), UniClientGen::do_select(), fcopy(), WvStream::flush_outbuf(), WvStream::getline(), WvStream::isreadable(), WvStream::iswritable(), main(), WvStreamClone::post_select(), WvFDStream::post_select(), WvHTTPStream::pre_select(), and runtests().

bool WvLogRcv::set_custom_levels WvString  descr  )  [inherited]
 

Definition at line 290 of file wvlog.cc.

References WvLogRcv::custom_levels, WvString::edit(), WvLogRcv::set_custom_levels(), WvStringList::split(), strlwr(), and trim_string().

Referenced by WvLogRcv::set_custom_levels().

void WvStream::setcallback WvStreamCallback  _callfunc,
void *  _userdata
[inline, inherited]
 

define the callback function for this stream, called whenever the callback() member is run, and passed the 'userdata' pointer.

Definition at line 573 of file wvstream.h.

Referenced by WvUnixListener::accept_callback(), WvTCPListener::accept_callback(), WvStream::autoforward(), main(), WvStream::noautoforward(), runtests(), UniConfDaemon::setupsslsocket(), UniConfDaemon::setuptcpsocket(), UniConfDaemon::setupunixsocket(), UniClientGen::UniClientGen(), WvDelayedCallback< InnerCallback >::WvDelayedCallback(), and WvDelayedCallback< InnerCallback >::~WvDelayedCallback().

void WvStream::setclosecallback WvStreamCallback  _callfunc,
void *  _userdata
[inline, virtual, inherited]
 

Sets a callback to be invoked on close().

Implements IWvStream.

Definition at line 577 of file wvstream.h.

void WvError::seterr const WvError err  )  [inherited]
 

Definition at line 64 of file wverror.cc.

References WvError::errstr(), WvError::geterr(), and WvError::seterr().

void WvStream::seterr WVSTRING_FORMAT_DECL   )  [inline, inherited]
 

Reimplemented from WvError.

Definition at line 202 of file wvstream.h.

References WVSTRING_FORMAT_CALL.

void WvStream::seterr WvStringParm  specialerr  )  [inline, inherited]
 

Reimplemented from WvError.

Definition at line 200 of file wvstream.h.

References WvStringParm.

void WvStream::seterr int  _errnum  )  [virtual, inherited]
 

Override seterr() from WvError so that it auto-closes the stream.

Reimplemented from WvError.

Definition at line 272 of file wvstream.cc.

References WvStream::close(), and WvStream::seterr().

Referenced by WvStream::_do_select(), WvHttpStream::execute(), WvConf::load_file(), and WvStream::seterr().

void WvFDStream::setfd int  fd  )  [inline, protected, inherited]
 

Sets the file descriptor for both reading and writing.

Convenience method.

Definition at line 33 of file wvfdstream.h.

References WvFDStream::rfd, WvFDStream::setfd(), and WvFDStream::wfd.

Referenced by WvFDStream::setfd().

bool WvStream::should_flush  )  [virtual, inherited]
 

Returns true if we want to flush the output buffer right now.

This allows us to implement delayed_flush(), flush_then_close(), etc, but it's still super-ugly and probably needs to go away. (In fact, all our buffer flushing is super-ugly right now.)

Implements IWvStream.

Definition at line 566 of file wvstream.cc.

References WvStream::want_to_flush.

Referenced by WvFDStream::post_select(), and WvStream::write().

const WvAddr * WvStream::src  )  const [virtual, inherited]
 

get the remote address from which the last data block was received.

May be NULL. The pointer becomes invalid upon the next call to read().

Implements IWvStream.

Reimplemented in WvIPRawStream, WvStreamClone, WvTCPConn, WvTCPListener, WvUDPStream, WvUnixConn, and WvUnixListener.

Definition at line 898 of file wvstream.cc.

Referenced by UniConfDaemon::accept().

void WvStream::terminate_continue_select  )  [inherited]
 

you MUST run this from your destructor if you use continue_select(), or very weird things will happen if someone deletes your object while in continue_select().

Definition at line 885 of file wvstream.cc.

References WvStream::close(), WvTask::isrunning(), WvTask::recycle(), WvTaskMan::run(), WvStream::task, and WvStream::taskman.

void WvStream::undo_force_select bool  readable,
bool  writable,
bool  isexception = false
[inherited]
 

Undo a previous force_select() - ie.

un-forces the options which are 'true', and leaves the false ones alone.

Definition at line 818 of file wvstream.cc.

References WvStream::force, and WvStream::undo_force_select().

Referenced by WvStream::undo_force_select().

void WvStream::unread WvBuf outbuf,
size_t  count
[virtual, inherited]
 

Puts data back into the stream's internal buffer.

We cheat so that there's no restriction on how much (or what) data can be unread(). This is different from WvBuf::unget() (which is rather restrictive).

Definition at line 904 of file wvstream.cc.

References WvStream::inbuf, WvBufBaseCommonImpl< T >::merge(), WvStream::unread(), and WvBufBaseCommonImpl< T >::zap().

Referenced by WvStream::unread().

size_t WvFDStream::uread void *  buf,
size_t  count
[virtual, inherited]
 

unbuffered I/O functions; these ignore the buffer, which is handled by read().

Don't call these functions explicitly unless you have a _really_ good reason.

This is what you would override in a derived class.

Reimplemented from WvStream.

Reimplemented in WvIPRawStream, WvTCPListener, WvUDPStream, WvUnixListener, and WvFileWatcher.

Definition at line 85 of file wvfdstream.cc.

References WvFDStream::isok(), WvFDStream::rfd, and WvFDStream::uread().

Referenced by WvFDStream::uread().

size_t WvFDStream::uwrite const void *  buf,
size_t  count
[virtual, inherited]
 

unbuffered I/O functions; these ignore the buffer, which is handled by write().

Don't call these functions explicitly unless you have a _really_ good reason.

This is what you would override in a derived class.

Reimplemented from WvStream.

Reimplemented in WvIPRawStream, WvTCPConn, WvTCPListener, WvUDPStream, WvUnixListener, and WvFileWatcher.

Definition at line 105 of file wvfdstream.cc.

References WvFDStream::isok(), WvFDStream::rfd, WvBufBaseCommonImpl< T >::used(), WvFDStream::uwrite(), and WvFDStream::wfd.

Referenced by WvFDStream::uwrite().

size_t WvStream::write WvStringParm  s  )  [inline, inherited]
 

print a preformatted WvString to the stream.

see the simple version of write() way up above.

Definition at line 614 of file wvstream.h.

References WvFastString::cstr(), and WvFastString::len().

size_t WvStream::write WvBuf inbuf,
size_t  count = INT_MAX
[virtual, inherited]
 

Writes data to the stream from the given buffer.

Returns the actual amount written.

If count is greater than the amount of data available in the buffer, only writes at most that amount.

Implements IWvStream.

Definition at line 314 of file wvstream.cc.

References WvBufBaseCommonImpl< unsigned char >::get(), WvBufBaseCommonImpl< unsigned char >::unget(), WvBufBaseCommonImpl< unsigned char >::used(), and WvStream::write().

size_t WvStream::write const void *  buf,
size_t  count
[virtual, inherited]
 

Write data to the stream.

Returns the actual amount written. Since WvStream has an output buffer, it *always* successfully "writes" the full amount (but you might have to flush the buffers later so it actually gets sent).

Implements IWvStream.

Definition at line 397 of file wvstream.cc.

References WvStream::flush(), WvStream::flush_outbuf(), WvStream::is_auto_flush, WvStream::isok(), WvStream::max_outbuf_size, WvStream::outbuf, WvStream::outbuf_delayed_flush, WvBufBaseCommonImpl< T >::put(), WvStream::should_flush(), WvBufBaseCommonImpl< T >::used(), WvStream::uwrite(), and WvStream::write().

Referenced by WvStream::autoforward_callback(), WvHttpStream::execute(), WvFtpStream::execute(), main(), WvLog::operator()(), WvProtoStream::uwrite(), WvDsp::uwrite(), WvStream::write(), and WvPamStream::WvPamStream().

bool WvStream::xpost_select SelectInfo &  si,
const SelectRequest &  r
[inline, inherited]
 

Like post_select(), but still exists even if you override the other post_select() in a subclass.

Sigh.

Definition at line 440 of file wvstream.h.

bool WvStream::xpre_select SelectInfo &  si,
const SelectRequest &  r
[inline, inherited]
 

Like pre_select(), but still exists even if you override the other pre_select() in a subclass.

Sigh.

Definition at line 419 of file wvstream.h.


Member Data Documentation

WvTime WvStream::alarm_time [protected, inherited]
 

Definition at line 690 of file wvstream.h.

Referenced by WvStream::alarm(), WvStream::alarm_remaining(), and WvStream::callback().

bool WvStream::alarm_was_ticking [inherited]
 

This will be true during callback execution if the callback was triggered by the alarm going off.

Definition at line 183 of file wvstream.h.

Referenced by WvStream::callback(), UniClientGen::conncallback(), WvStream::continue_read(), and WvStream::continue_select().

bool WvLogRcv::at_newline [protected, inherited]
 

Definition at line 33 of file wvlogrcv.h.

Referenced by WvLogRcv::end_line(), and WvLogRcv::WvLogRcv().

time_t WvStream::autoclose_time [protected, inherited]
 

Definition at line 689 of file wvstream.h.

Referenced by WvStream::flush_outbuf(), and WvStream::flush_then_close().

WvStreamCallback WvStream::callfunc [protected, inherited]
 

Definition at line 673 of file wvstream.h.

Referenced by WvStream::_callback().

void* WvStream::closecb_data [protected, inherited]
 

Definition at line 676 of file wvstream.h.

Referenced by WvStream::close().

WvStreamCallback WvStream::closecb_func [protected, inherited]
 

Definition at line 674 of file wvstream.h.

Referenced by WvStream::close().

Src_LvlDict WvLogRcv::custom_levels [protected, inherited]
 

Definition at line 48 of file wvlogrcv.h.

Referenced by WvLogRcv::log(), and WvLogRcv::set_custom_levels().

int WvError::errnum [protected, inherited]
 

Definition at line 22 of file wverror.h.

Referenced by WvError::errstr(), WvError::geterr(), WvError::isok(), WvError::noerr(), and WvError::seterr().

WvString WvError::errstring [protected, inherited]
 

Definition at line 23 of file wverror.h.

Referenced by WvError::errstr(), and WvError::seterr().

SelectRequest WvStream::force [inherited]
 

'force' is the list of default SelectRequest values when you use the variant of select() that doesn't override them.

Definition at line 159 of file wvstream.h.

Referenced by WvStream::_build_selectinfo(), WvStream::force_select(), WvStream::pre_select(), and WvStream::undo_force_select().

WvStream * WvStream::globalstream = NULL [static, protected, inherited]
 

Definition at line 38 of file wvstream.cc.

Referenced by WvStream::_build_selectinfo(), and WvStream::_process_selectinfo().

WvDynBuf WvStream::inbuf [protected, inherited]
 

Definition at line 672 of file wvstream.h.

Referenced by WvStream::getline(), WvStream::pre_select(), WvStream::read(), and WvStream::unread().

bool WvStream::is_auto_flush [protected, inherited]
 

Definition at line 679 of file wvstream.h.

Referenced by WvStream::write().

bool WvStream::is_flushing [protected, inherited]
 

Definition at line 686 of file wvstream.h.

Referenced by WvStream::flush().

WvTime WvStream::last_alarm_check [protected, inherited]
 

Definition at line 691 of file wvstream.h.

Referenced by WvStream::alarm_remaining().

WvLog::LogLevel WvLogRcv::last_level [protected, inherited]
 

Definition at line 32 of file wvlogrcv.h.

Referenced by WvLogRcv::_make_prefix(), WvLogRcv::log(), and WvLogRcv::WvLogRcv().

const WvLog* WvLogRcv::last_source [protected, inherited]
 

Definition at line 31 of file wvlogrcv.h.

Referenced by WvLogRcv::_make_prefix(), WvLogRcv::log(), and WvLogRcv::WvLogRcv().

char * WvLogRcv::loglevels [static, inherited]
 

Initial value:

{ "Crit", "Err", "Warn", "Notice", "Info", "*1", "*2", "*3", "*4", "*5", }

Definition at line 23 of file wvlog.cc.

Referenced by WvLogRcv::_make_prefix().

WvLog::LogLevel WvLogRcv::max_level [protected, inherited]
 

Definition at line 32 of file wvlogrcv.h.

Referenced by WvLogRcv::level(), WvLogRcv::log(), and WvLogRcv::WvLogRcv().

size_t WvStream::max_outbuf_size [protected, inherited]
 

Definition at line 677 of file wvstream.h.

Referenced by WvStream::write().

WvDynBuf WvStream::outbuf [protected, inherited]
 

Definition at line 672 of file wvstream.h.

Referenced by WvStream::flush_outbuf(), WvStream::flush_then_close(), and WvStream::write().

bool WvStream::outbuf_delayed_flush [protected, inherited]
 

Definition at line 678 of file wvstream.h.

Referenced by WvStream::flush_outbuf(), and WvStream::write().

size_t WvStream::personal_stack_size [inherited]
 

Specifies the stack size to reserve for continue_select().

Definition at line 177 of file wvstream.h.

Referenced by WvStream::callback().

WvString WvLogRcv::prefix [protected, inherited]
 

Definition at line 34 of file wvlogrcv.h.

Referenced by WvLogRcv::_begin_line(), and WvLogRcv::_make_prefix().

size_t WvLogRcv::prelen [protected, inherited]
 

Definition at line 35 of file wvlogrcv.h.

Referenced by WvLogRcv::_begin_line(), and WvLogRcv::_make_prefix().

size_t WvStream::queue_min [protected, inherited]
 

Definition at line 688 of file wvstream.h.

Referenced by WvStream::pre_select(), and WvStream::read().

WvStream* WvStream::read_requires_writable [inherited]
 

If this is set, select() doesn't return true for read unless the given stream also returns true for write.

Definition at line 165 of file wvstream.h.

Referenced by WvStream::autoforward(), and WvStream::noautoforward().

bool WvFile::readable [inherited]
 

Definition at line 30 of file wvfile.h.

Referenced by WvFile::open(), WvFile::pre_select(), and WvFile::WvFile().

int WvFDStream::rfd [protected, inherited]
 

The file descriptor for reading.

Definition at line 24 of file wvfdstream.h.

Referenced by WvFDStream::close(), WvFDStream::getfd(), WvFDStream::getrfd(), WvFDStream::isok(), WvFDStream::noread(), WvFDStream::nowrite(), WvFDStream::post_select(), WvFDStream::pre_select(), WvFDStream::setfd(), WvFDStream::uread(), and WvFDStream::uwrite().

bool WvStream::running_callback [protected, inherited]
 

Definition at line 692 of file wvstream.h.

Referenced by WvStream::_callback(), WvStream::alarm_remaining(), WvStream::callback(), WvStream::continue_select(), and WvStream::~WvStream().

bool WvFile::skip_select [inherited]
 

Definition at line 33 of file wvfile.h.

Referenced by WvFile::open(), and WvFile::pre_select().

WvTask* WvStream::task [protected, inherited]
 

Definition at line 695 of file wvstream.h.

Referenced by WvStream::callback(), WvStream::continue_select(), WvStream::terminate_continue_select(), and WvStream::~WvStream().

WvTaskMan* WvStream::taskman [protected, inherited]
 

Definition at line 670 of file wvstream.h.

Referenced by WvStream::callback(), WvStream::continue_select(), WvStream::terminate_continue_select(), and WvStream::~WvStream().

void* WvStream::userdata [protected, inherited]
 

Definition at line 675 of file wvstream.h.

Referenced by WvStream::_callback().

bool WvStream::uses_continue_select [inherited]
 

If this is set, enables the use of continue_select().

Definition at line 174 of file wvstream.h.

Referenced by WvStream::callback(), WvStream::continue_read(), WvStream::continue_select(), and WvStream::getline().

bool WvStream::want_nowrite [protected, inherited]
 

Definition at line 680 of file wvstream.h.

Referenced by WvStream::nowrite().

bool WvStream::want_to_flush [protected, inherited]
 

Definition at line 683 of file wvstream.h.

Referenced by WvStream::flush(), WvStream::flush_outbuf(), and WvStream::should_flush().

int WvFDStream::wfd [protected, inherited]
 

The file descriptor for writing.

Definition at line 27 of file wvfdstream.h.

Referenced by WvFDStream::close(), WvFDStream::getfd(), WvFDStream::getwfd(), WvFDStream::isok(), WvFDStream::noread(), WvFDStream::nowrite(), WvFDStream::post_select(), WvFDStream::pre_select(), WvFDStream::setfd(), and WvFDStream::uwrite().

bool WvFile::writable [inherited]
 

Definition at line 30 of file wvfile.h.

Referenced by WvFile::open(), WvFile::pre_select(), and WvFile::WvFile().

WvStream* WvStream::write_requires_readable [inherited]
 

If this is set, select() doesn't return true for write unless the given stream also returns true for read.

Definition at line 171 of file wvstream.h.

bool WvStream::wvstream_execute_called [protected, inherited]
 

Definition at line 693 of file wvstream.h.

Referenced by WvStream::_callback(), and WvStream::execute().

const XUUID IWvStream::XIID [static, inherited]
 

Definition at line 139 of file wvstream.h.


The documentation for this class was generated from the following files:
Generated on Tue Oct 5 01:09:28 2004 for WvStreams by doxygen 1.3.7