#include <wvmagiccircle.h>
Definition at line 14 of file wvmagiccircle.h.
Public Member Functions | |
WvMagicCircle (size_t size) | |
Creates a shared memory circular queue. | |
size_t | used () |
size_t | left () |
size_t | put (const void *data, size_t len) |
size_t | get (void *data, size_t len) |
size_t | skip (size_t len) |
const char * | wstype () const |
virtual bool | isok () const |
By default, returns true if geterr() == 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 WvErrorBase &err) |
void | seterr_both (int _errnum, WvStringParm specialerr) |
void | noerr () |
Reset our error state - there's no error condition anymore. | |
Static Public Member Functions | |
static WvString | strerror (int errnum) |
A replacement for the operating system strerror() function that can map more kinds of error strings (especially in win32). | |
Protected Attributes | |
WvShmZone | shm |
volatile int & | head |
volatile int & | tail |
int | size |
char * | circle |
int | errnum |
WvString | errstring |
WvMagicCircle::WvMagicCircle | ( | size_t | size | ) |
Creates a shared memory circular queue.
"size" is the number of elements to store
Definition at line 11 of file wvmagiccircle.cc.
References WvShmZone::cbuf, WvErrorBase::geterr(), and WvErrorBase::seterr().
virtual bool WvErrorBase::isok | ( | ) | const [inline, virtual, inherited] |
By default, returns true if geterr() == 0.
Might be overridden so that isok() == false even though no error code has been specified.
Reimplemented in WvBufStream, WvDSAKey, WvDsp, WvEncoderStream, WvFdStream, WvIStreamList, WvLog, WvSSLStream, WvStream, WvStreamClone, WvTCPConn, WvTimeoutStream, and WvTimeStream.
Definition at line 39 of file wverror.h.
Referenced by WvStream::isok(), and WvGlob::set().
virtual int WvErrorBase::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 WvStreamClone.
Definition at line 48 of file wverror.h.
Referenced by UniIniGen::commit(), UniFileSystemGen::get(), WvStreamClone::geterr(), UniIniGen::refresh(), WvStream::seterr(), and WvMagicCircle().
void WvErrorBase::seterr | ( | int | _errnum | ) | [virtual, inherited] |
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 144 of file wverror.cc.
Referenced by WvDSAKey::getpem(), WvGlob::set(), WvStream::seterr(), WvMagicCircle(), and WvShmZone::WvShmZone().
void WvErrorBase::noerr | ( | ) | [inline, inherited] |