WvShmZone Class Reference

#include <wvshmzone.h>

Inheritance diagram for WvShmZone:
[legend]

List of all members.


Detailed Description

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.


Public Member Functions

 WvShmZone (size_t size)
 Creates a shared memory zone.
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).

Public Attributes

int size
union {
   void *   buf
   char *   cbuf
   unsigned char *   ucbuf
}; 

Protected Attributes

int errnum
WvString errstring

Constructor & Destructor Documentation

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().


Member Function Documentation

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

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.

Definition at line 48 of file wverror.h.

Referenced by WvMagicCircle::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).

Definition at line 143 of file wverror.cc.

Referenced by WvDSAKey::getpem(), WvGlob::set(), WvStream::seterr(), WvMagicCircle::WvMagicCircle(), and WvShmZone().

void WvErrorBase::noerr (  )  [inline, inherited]

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

Definition at line 76 of file wverror.h.


The documentation for this class was generated from the following files:
Generated on Thu Jan 24 16:51:05 2008 for WvStreams by  doxygen 1.5.4