#include <wvstream.h>
Inherits IObject, and WvError.
Inherited by GenericComponent< IWvStream >.
Collaboration diagram for IWvStream:
Public Member Functions | |
IWvStream () | |
virtual | ~IWvStream () |
virtual void | close ()=0 |
virtual bool | isok () const =0 |
By default, returns true if geterr() == 0. | |
virtual void | callback ()=0 |
virtual int | getrfd () const =0 |
virtual int | getwfd () const =0 |
virtual const WvAddr * | src () const =0 |
virtual bool | pre_select (SelectInfo &si)=0 |
virtual bool | post_select (SelectInfo &si)=0 |
virtual size_t | read (void *buf, size_t count)=0 |
virtual size_t | write (const void *buf, size_t count)=0 |
virtual size_t | read (WvBuf &outbuf, size_t count)=0 |
virtual size_t | write (WvBuf &inbuf, size_t count=INT_MAX)=0 |
virtual void | noread ()=0 |
Shuts down the reading side of the stream. | |
virtual void | nowrite ()=0 |
Shuts down the writing side of the stream. | |
virtual bool | isreadable ()=0 |
Returns true if the stream is readable. | |
virtual bool | iswritable ()=0 |
Returns true if the stream is writable (without using the outbuf). | |
virtual bool | flush (time_t msec_timeout)=0 |
flush the output buffer, if we can do it without delaying more than msec_timeout milliseconds at a time. | |
virtual bool | should_flush ()=0 |
Returns true if we want to flush the output buffer right now. | |
virtual void | setclosecallback (WvStreamCallback _callfunc, void *_userdata)=0 |
Sets a callback to be invoked on close(). | |
virtual unsigned int | addRef ()=0 |
virtual unsigned int | release ()=0 |
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 |
virtual void | seterr (int _errnum) |
Set the errnum variable -- we have an error. | |
void | seterr (WvStringParm specialerr) |
void | seterr (WVSTRING_FORMAT_DECL) |
void | seterr (const WvError &err) |
void | noerr () |
Reset our error state - there's no error condition anymore. | |
Static Public Attributes | |
const XUUID | XIID |
Protected Attributes | |
int | errnum |
WvString | errstring |
|
Definition at line 82 of file wvstream.cc. |
|
Definition at line 87 of file wvstream.cc. |
|
Implemented in WvMonikerRegistry, GenericComponent< IObject >, and GenericComponent< IWvStream >. Referenced by WvMonikerRegistry::create(). |
|
Implemented in WvStream. Referenced by WvStreamClone::execute(), WvIStreamList::execute(), and WvStream::runonce(). |
|
Implemented in UniClientConn, WvBufStream, WvDsp, WvEncoderStream, WvFDStream, WvUrlStream, WvHttpStream, WvFtpStream, WvModemBase, WvModem, WvSSLStream, WvStream, WvStreamClone, WvTCPListener, WvUnixListener, UniConfDaemon, and UniConfDaemonConn. Referenced by WvStreamClone::close(). |
|
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(). |
|
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 it finished flushing (ie. the outbuf is empty). FIXME: Something like this probably belongs in IWvStream, but probably not exactly this. Implemented in WvStream. Referenced by WvStreamClone::flush_internal(). |
|
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(). |
|
Implemented in WvFDStream, and WvStream. |
|
Implemented in WvFDStream, and WvStream. |
|
By default, returns true if geterr() == 0. Might be overridden so that isok() == false even though no error code has been specified. Reimplemented from WvError. Implemented in UniClientConn, WvBufStream, WvDailyEvent, WvDsp, WvEncoderStream, WvFDStream, WvHTTPStream, WvIStreamList, WvLog, WvPamStream, WvSSLStream, WvStream, WvStreamClone, WvStreamList, WvTCPConn, WvTimeoutStream, WvTimeStream, WvFileWatcher, and UniConfDaemon. Referenced by WvIStreamList::execute(), WvStreamClone::isok(), WvStreamClone::post_select(), WvSSLStream::post_select(), WvIStreamList::post_select(), WvStreamClone::pre_select(), and WvIStreamList::pre_select(). |
|
Returns true if the stream is readable.
Implemented in WvStream. |
|
Returns true if the stream is writable (without using the outbuf).
Implemented in WvStream. |
|
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(). |
|
Shuts down the reading side of the stream. Subsequent calls to read() will fail. Implemented in WvFDStream, and WvStream. |
|
Shuts down the writing side of the stream. Subsequent calls to write() will fail. Implemented in WvFDStream, WvStream, and WvStreamClone. Referenced by WvStreamClone::nowrite(). |
|
Implemented in WvDailyEvent, WvDsp, WvFDStream, WvHttpStream, WvFtpStream, WvIStreamList, WvSSLStream, WvStream, WvStreamClone, WvStreamList, WvSyncStream, WvTCPConn, and WvTimeStream. Referenced by WvStreamClone::post_select(), and WvIStreamList::post_select(). |
|
Implemented in UniClientConn, WvBufStream, WvDailyEvent, WvDsp, WvEncoderStream, WvFDStream, WvFile, WvHTTPStream, WvHttpStream, WvFtpStream, WvHttpPool, WvIStreamList, WvLog, WvSSLStream, WvStream, WvStreamClone, WvStreamList, WvSyncStream, WvTCPConn, WvTimeStream, and WvFileWatcher. Referenced by WvStreamClone::pre_select(), and WvIStreamList::pre_select(). |
|
Implemented in WvStream. |
|
Implemented in WvStream. Referenced by WvStreamClone::uread(). |
|
Implemented in WvMonikerRegistry, GenericComponent< IObject >, and GenericComponent< IWvStream >. |
|
Sets a callback to be invoked on close().
Implemented in WvStream. Referenced by WvStreamClone::close(), and WvStreamClone::setclone(). |
|
Definition at line 64 of file wverror.cc. References WvError::errstr(), WvError::geterr(), and WvError::seterr(). |
|
Reimplemented in WvStream. Definition at line 60 of file wverror.h. References WvError::seterr(), and WVSTRING_FORMAT_CALL. |
|
Reimplemented in WvStream. Definition at line 54 of file wverror.cc. References WvError::errnum, WvError::errstring, WvError::seterr(), and WvStringParm. |
|
Set the errnum variable -- we have an error. If called more than once, seterr() doesn't change the error code away from the previous one. That way, we remember the _original_ cause of our problems. Subclasses may want to override seterr(int) to shut themselves down (eg. WvStream::close()) when an error condition is set. Note that seterr(WvString) will call seterr(-1). Reimplemented in WvStream. Definition at line 47 of file wverror.cc. References WvError::errnum, and WvError::seterr(). Referenced by main(), and WvError::seterr(). |
|
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.) Implemented in WvStream. Referenced by WvStreamClone::post_select(). |
|
Implemented in WvIPRawStream, WvStream, WvStreamClone, WvTCPConn, WvTCPListener, WvUDPStream, WvUnixConn, and WvUnixListener. Referenced by WvStreamClone::src(). |
|
Implemented in WvStream. |
|
Implemented in WvStream. Referenced by WvStreamClone::uwrite(). |
|
Definition at line 22 of file wverror.h. Referenced by WvError::errstr(), WvError::geterr(), WvError::isok(), WvError::noerr(), and WvError::seterr(). |
|
Definition at line 23 of file wverror.h. Referenced by WvError::errstr(), and WvError::seterr(). |
|
Definition at line 139 of file wvstream.h. |