WvStreams
|
Represents a shared-memory zone via mmap(). More...
#include <wvshmzone.h>
Public Member Functions | |
WvShmZone (size_t size) | |
Creates a shared memory zone. More... | |
virtual bool | isok () const |
By default, returns true if geterr() == 0. More... | |
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. More... | |
virtual WvString | errstr () const |
virtual void | seterr (int _errnum) |
Set the errnum variable – we have an error. More... | |
void | seterr (WvStringParm specialerr) |
void | seterr (WVSTRING_FORMAT_DECL) |
void | seterr (const WvErrorBase &err) |
void | seterr_both (int _errnum, WvStringParm specialerr) |
void | seterr_both (int _errnum, WVSTRING_FORMAT_DECL) |
void | noerr () |
Reset our error state - there's no error condition anymore. More... | |
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). More... | |
Public Attributes | |
int | size |
union { | |
void * buf | |
char * cbuf | |
unsigned char * ucbuf | |
}; | |
Protected Attributes | |
int | errnum |
WvString | errstring |
Represents a shared-memory zone via mmap().
If you create one of these, its buf element will be shared across fork() and you can use it for various things such as a circular queue, semaphore, etc.
Definition at line 20 of file wvshmzone.h.
WvShmZone::WvShmZone | ( | size_t | size | ) |
Creates a shared memory zone.
"size" is the size of the zone in bytes
Definition at line 16 of file wvshmzone.cc.
References WvErrorBase::seterr().
WvShmZone::~WvShmZone | ( | ) |
Definition at line 40 of file wvshmzone.cc.
|
inlinevirtualinherited |
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, WvDBusServer, WvDSAKey, WvEncoderStream, WvFdStream, WvIStreamList, WvListener, WvNullListener, WvLog, WvSSLStream, WvStream, WvStreamClone, WvTCPConn, WvTimeoutStream, WvTimeStream, WvReadLineStream, _WvConStream, and IWvStream.
Definition at line 39 of file wverror.h.
Referenced by WvListener::isok(), WvStream::isok(), and WvGlob::set().
|
inlinevirtualinherited |
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 WvDBusServer, and WvStreamClone.
Definition at line 48 of file wverror.h.
Referenced by UniIniGen::commit(), UniFileSystemGen::get(), WvDBusServer::geterr(), WvStreamClone::geterr(), WvEncoderStream::isok(), UniConfDaemon::listen(), WvStream::seterr(), and WvMagicCircle::WvMagicCircle().
|
virtualinherited |
Definition at line 127 of file wverror.cc.
|
staticinherited |
A replacement for the operating system ::strerror() function that can map more kinds of error strings (especially in win32).
Definition at line 91 of file wverror.cc.
References WvErrorBase::strerror().
Referenced by WvLog::perror(), WvErrorBase::strerror(), WvSSLStream::uread(), and WvSSLStream::uwrite().
|
virtualinherited |
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 WvTCPListener::accept(), WvUnixListener::accept(), WvDSAKey::getpem(), WvGlob::set(), WvStream::seterr(), WvMagicCircle::WvMagicCircle(), WvPam::WvPam(), WvShmZone(), and WvTCPListener::WvTCPListener().
|
inherited |
Definition at line 159 of file wverror.cc.
|
inlineinherited |
|
inherited |
Definition at line 170 of file wverror.cc.
|
inherited |
Definition at line 179 of file wverror.cc.
|
inlineinherited |
|
inlineinherited |
int WvShmZone::size |
Definition at line 35 of file wvshmzone.h.
void* WvShmZone::buf |
Definition at line 38 of file wvshmzone.h.
char* WvShmZone::cbuf |
Definition at line 39 of file wvshmzone.h.
unsigned char* WvShmZone::ucbuf |
Definition at line 40 of file wvshmzone.h.