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

WvInPlaceBufStore Class Reference

#include <wvbufstore.h>

Inherits WvBufStore.

Collaboration diagram for WvInPlaceBufStore:

[legend]
List of all members.

Detailed Description

The WvInPlaceBuf storage class.

Definition at line 249 of file wvbufstore.h.

Public Member Functions

 WvInPlaceBufStore (int _granularity, void *_data, size_t _avail, size_t _size, bool _autofree)
 WvInPlaceBufStore (int _granularity, size_t _size)
virtual ~WvInPlaceBufStore ()
void * ptr () const
size_t size () const
bool autofree () const
void setautofree (bool _autofree)
void reset (void *_data, size_t _avail, size_t _size, bool _autofree)
void setavail (size_t _avail)
virtual size_t used () const
virtual const void * get (size_t count)
virtual void unget (size_t count)
virtual size_t ungettable () const
virtual void zap ()
virtual size_t free () const
virtual void * alloc (size_t count)
virtual void unalloc (size_t count)
virtual size_t unallocable () const
virtual void * mutablepeek (int offset, size_t count)
virtual bool isreadable () const
virtual size_t optgettable () const
virtual void skip (size_t count)
virtual size_t peekable (int offset) const
virtual size_t optpeekable (int offset) const
virtual const void * peek (int offset, size_t count)
void move (void *buf, size_t count)
void copy (void *buf, int offset, size_t count)
virtual bool iswritable () const
virtual size_t optallocable () const
void put (const void *data, size_t count)
void fastput (const void *data, size_t count)
void poke (const void *data, int offset, size_t count)
virtual void merge (WvBufStore &instore, size_t count)
void basicmerge (WvBufStore &instore, size_t count)

Protected Member Functions

virtual bool usessubbuffers () const
 Returns true if the buffer uses subbuffers for storage.

virtual size_t numsubbuffers () const
 Returns the number of subbuffers in the buffer.

virtual WvBufStorefirstsubbuffer () const
 Returns the first subbuffer.

virtual void appendsubbuffer (WvBufStore *buffer, bool autofree)
 Appends a subbuffer to the buffer.

virtual void prependsubbuffer (WvBufStore *buffer, bool autofree)
 Prepends a subbuffer to the buffer.

virtual bool unlinksubbuffer (WvBufStore *buffer, bool allowautofree)
 Unlinks the specified subbuffer.


Protected Attributes

void * data
size_t xsize
size_t readidx
size_t writeidx
bool xautofree
int granularity


Constructor & Destructor Documentation

WvInPlaceBufStore::WvInPlaceBufStore int  _granularity,
void *  _data,
size_t  _avail,
size_t  _size,
bool  _autofree
 

Definition at line 287 of file wvbufferstore.cc.

References reset().

WvInPlaceBufStore::WvInPlaceBufStore int  _granularity,
size_t  _size
 

Definition at line 295 of file wvbufferstore.cc.

References memops, and reset().

WvInPlaceBufStore::~WvInPlaceBufStore  )  [virtual]
 

Definition at line 302 of file wvbufferstore.cc.

References data, memops, and xautofree.


Member Function Documentation

void * WvInPlaceBufStore::alloc size_t  count  )  [virtual]
 

Implements WvBufStore.

Definition at line 372 of file wvbufferstore.cc.

References data, writeidx, and xsize.

virtual void WvBufStore::appendsubbuffer WvBufStore buffer,
bool  autofree
[inline, protected, virtual, inherited]
 

Appends a subbuffer to the buffer.

Reimplemented in WvLinkedBufferStore.

Definition at line 109 of file wvbufstore.h.

Referenced by WvBufStore::merge().

bool WvInPlaceBufStore::autofree  )  const [inline]
 

Definition at line 267 of file wvbufstore.h.

References xautofree.

Referenced by WvInPlaceBufBase< unsigned char >::autofree().

void WvBufStore::basicmerge WvBufStore instore,
size_t  count
[inherited]
 

Definition at line 229 of file wvbufferstore.cc.

References WvBufStore::alloc(), WvBufStore::get(), memops, WvBufStore::optallocable(), WvBufStore::optgettable(), and WvBufStore::unalloc().

Referenced by WvBufStore::merge().

void WvBufStore::copy void *  buf,
int  offset,
size_t  count
[inherited]
 

Definition at line 128 of file wvbufferstore.cc.

References memops, WvBufStore::optpeekable(), and WvBufStore::peek().

Referenced by WvBufBaseCommonImpl< unsigned >::copy().

void WvBufStore::fastput const void *  data,
size_t  count
[inherited]
 

Definition at line 163 of file wvbufferstore.cc.

References WvBufStore::alloc(), and memops.

Referenced by WvBufBaseCommonImpl< unsigned >::put().

virtual WvBufStore* WvBufStore::firstsubbuffer  )  const [inline, protected, virtual, inherited]
 

Returns the first subbuffer.

Returns: the buffer or NULL if none or not supported

Reimplemented in WvLinkedBufferStore.

Definition at line 105 of file wvbufstore.h.

Referenced by WvBufStore::merge().

size_t WvInPlaceBufStore::free  )  const [virtual]
 

Implements WvBufStore.

Definition at line 366 of file wvbufferstore.cc.

References writeidx, and xsize.

const void * WvInPlaceBufStore::get size_t  count  )  [virtual]
 

Implements WvBufStore.

Definition at line 336 of file wvbufferstore.cc.

References data, readidx, and writeidx.

virtual bool WvBufStore::isreadable  )  const [inline, virtual, inherited]
 

Reimplemented in WvBufCursorStore, and WvWriteOnlyBufferStoreMixin< WvReadOnlyBufferStoreMixin< WvBufStore > >.

Definition at line 45 of file wvbufstore.h.

Referenced by WvBufCursorStore::isreadable(), and WvBufBaseCommonImpl< unsigned >::isreadable().

virtual bool WvBufStore::iswritable  )  const [inline, virtual, inherited]
 

Reimplemented in WvBufCursorStore, and WvReadOnlyBufferStoreMixin< WvBufStore >.

Definition at line 68 of file wvbufstore.h.

Referenced by WvBufCursorStore::iswritable().

void WvBufStore::merge WvBufStore instore,
size_t  count
[virtual, inherited]
 

Reimplemented in WvReadOnlyBufferStoreMixin< WvBufStore >.

Definition at line 198 of file wvbufferstore.cc.

References WvBufStore::appendsubbuffer(), WvBufStore::basicmerge(), WvBufStore::firstsubbuffer(), WvBufStore::unlinksubbuffer(), WvBufStore::used(), and WvBufStore::usessubbuffers().

Referenced by WvLinkedBufferStore::coalesce(), and WvBufBaseCommonImpl< unsigned >::merge().

void WvBufStore::move void *  buf,
size_t  count
[inherited]
 

Definition at line 111 of file wvbufferstore.cc.

References WvBufStore::get(), memops, and WvBufStore::optgettable().

Referenced by WvBufBaseCommonImpl< unsigned >::move().

void * WvInPlaceBufStore::mutablepeek int  offset,
size_t  count
[virtual]
 

Implements WvBufStore.

Definition at line 396 of file wvbufferstore.cc.

References data, readidx, and writeidx.

virtual size_t WvBufStore::numsubbuffers  )  const [inline, protected, virtual, inherited]
 

Returns the number of subbuffers in the buffer.

Reimplemented in WvLinkedBufferStore.

Definition at line 98 of file wvbufstore.h.

virtual size_t WvBufStore::optallocable  )  const [inline, virtual, inherited]
 

Reimplemented in WvCircularBufStore, WvLinkedBufferStore, WvDynBufStore, and WvReadOnlyBufferStoreMixin< WvBufStore >.

Definition at line 71 of file wvbufstore.h.

References WvBufStore::free().

Referenced by WvBufStore::basicmerge(), WvBufBaseCommonImpl< unsigned >::optallocable(), and WvBufStore::put().

virtual size_t WvBufStore::optgettable  )  const [inline, virtual, inherited]
 

Reimplemented in WvCircularBufStore, WvLinkedBufferStore, WvBufCursorStore, and WvWriteOnlyBufferStoreMixin< WvReadOnlyBufferStoreMixin< WvBufStore > >.

Definition at line 48 of file wvbufstore.h.

References WvBufStore::used().

Referenced by WvBufStore::basicmerge(), WvBufStore::move(), and WvBufBaseCommonImpl< unsigned >::optgettable().

virtual size_t WvBufStore::optpeekable int  offset  )  const [inline, virtual, inherited]
 

Reimplemented in WvLinkedBufferStore, WvBufCursorStore, and WvWriteOnlyBufferStoreMixin< WvReadOnlyBufferStoreMixin< WvBufStore > >.

Definition at line 56 of file wvbufstore.h.

References WvBufStore::peekable().

Referenced by WvBufStore::copy(), WvBufCursorStore::optgettable(), WvBufCursorStore::optpeekable(), WvLinkedBufferStore::optpeekable(), WvBufBaseCommonImpl< unsigned >::optpeekable(), and WvBufStore::poke().

virtual const void* WvBufStore::peek int  offset,
size_t  count
[inline, virtual, inherited]
 

Reimplemented in WvConstInPlaceBufStore, WvBufCursorStore, and WvWriteOnlyBufferStoreMixin< WvReadOnlyBufferStoreMixin< WvBufStore > >.

Definition at line 58 of file wvbufstore.h.

References WvBufStore::mutablepeek().

Referenced by WvBufStore::copy(), WvBufCursorStore::get(), WvBufCursorStore::peek(), and WvBufBaseCommonImpl< unsigned >::peek().

size_t WvBufStore::peekable int  offset  )  const [virtual, inherited]
 

Reimplemented in WvBufCursorStore, and WvWriteOnlyBufferStoreMixin< WvReadOnlyBufferStoreMixin< WvBufStore > >.

Definition at line 90 of file wvbufferstore.cc.

References WvBufStore::ungettable(), and WvBufStore::used().

Referenced by WvLinkedBufferStore::mutablepeek(), WvBufStore::optpeekable(), WvBufBaseCommonImpl< unsigned >::optpeekable(), and WvBufBaseCommonImpl< unsigned >::peekable().

void WvBufStore::poke const void *  data,
int  offset,
size_t  count
[inherited]
 

Definition at line 170 of file wvbufferstore.cc.

References memops, WvBufStore::mutablepeek(), WvBufStore::optpeekable(), WvBufStore::put(), and WvBufStore::used().

Referenced by WvBufBaseCommonImpl< unsigned >::poke().

virtual void WvBufStore::prependsubbuffer WvBufStore buffer,
bool  autofree
[inline, protected, virtual, inherited]
 

Prepends a subbuffer to the buffer.

Reimplemented in WvLinkedBufferStore.

Definition at line 113 of file wvbufstore.h.

void* WvInPlaceBufStore::ptr  )  const [inline]
 

Definition at line 263 of file wvbufstore.h.

References data.

Referenced by WvInPlaceBufBase< unsigned char >::ptr().

void WvBufStore::put const void *  data,
size_t  count
[inherited]
 

Definition at line 146 of file wvbufferstore.cc.

References WvBufStore::alloc(), memops, and WvBufStore::optallocable().

Referenced by WvBufStore::poke(), and WvBufBaseCommonImpl< unsigned >::put().

void WvInPlaceBufStore::reset void *  _data,
size_t  _avail,
size_t  _size,
bool  _autofree
 

Definition at line 309 of file wvbufferstore.cc.

References data, memops, setavail(), xautofree, and xsize.

Referenced by WvInPlaceBufBase< unsigned char >::reset(), and WvInPlaceBufStore().

void WvInPlaceBufStore::setautofree bool  _autofree  )  [inline]
 

Definition at line 269 of file wvbufstore.h.

References xautofree.

Referenced by WvInPlaceBufBase< unsigned char >::setautofree().

void WvInPlaceBufStore::setavail size_t  _avail  ) 
 

Definition at line 322 of file wvbufferstore.cc.

References readidx, writeidx, and xsize.

Referenced by reset(), and WvInPlaceBufBase< unsigned char >::setavail().

size_t WvInPlaceBufStore::size  )  const [inline]
 

Definition at line 265 of file wvbufstore.h.

References xsize.

Referenced by WvInPlaceBufBase< unsigned char >::size().

virtual void WvBufStore::skip size_t  count  )  [inline, virtual, inherited]
 

Reimplemented in WvBufCursorStore, and WvWriteOnlyBufferStoreMixin< WvReadOnlyBufferStoreMixin< WvBufStore > >.

Definition at line 51 of file wvbufstore.h.

References WvBufStore::get().

Referenced by WvLinkedBufferStore::coalesce(), and WvBufBaseCommonImpl< unsigned >::skip().

void WvInPlaceBufStore::unalloc size_t  count  )  [virtual]
 

Implements WvBufStore.

Definition at line 382 of file wvbufferstore.cc.

References readidx, and writeidx.

size_t WvInPlaceBufStore::unallocable  )  const [virtual]
 

Implements WvBufStore.

Definition at line 390 of file wvbufferstore.cc.

References readidx, and writeidx.

void WvInPlaceBufStore::unget size_t  count  )  [virtual]
 

Implements WvBufStore.

Definition at line 346 of file wvbufferstore.cc.

References readidx.

size_t WvInPlaceBufStore::ungettable  )  const [virtual]
 

Implements WvBufStore.

Definition at line 354 of file wvbufferstore.cc.

References readidx.

virtual bool WvBufStore::unlinksubbuffer WvBufStore buffer,
bool  allowautofree
[inline, protected, virtual, inherited]
 

Unlinks the specified subbuffer.

Only autofrees the buffer if allowautofree == true. Returns: the autofree flag for the buffer

Reimplemented in WvLinkedBufferStore.

Definition at line 121 of file wvbufstore.h.

Referenced by WvBufStore::merge().

size_t WvInPlaceBufStore::used  )  const [virtual]
 

Implements WvBufStore.

Definition at line 330 of file wvbufferstore.cc.

References readidx, and writeidx.

virtual bool WvBufStore::usessubbuffers  )  const [inline, protected, virtual, inherited]
 

Returns true if the buffer uses subbuffers for storage.

Reimplemented in WvLinkedBufferStore.

Definition at line 94 of file wvbufstore.h.

Referenced by WvBufStore::merge().

void WvInPlaceBufStore::zap  )  [virtual]
 

Implements WvBufStore.

Definition at line 360 of file wvbufferstore.cc.

References readidx, and writeidx.


Member Data Documentation

void* WvInPlaceBufStore::data [protected]
 

Definition at line 252 of file wvbufstore.h.

Referenced by alloc(), get(), mutablepeek(), ptr(), reset(), and ~WvInPlaceBufStore().

int WvBufStore::granularity [protected, inherited]
 

Definition at line 31 of file wvbufstore.h.

size_t WvInPlaceBufStore::readidx [protected]
 

Definition at line 254 of file wvbufstore.h.

Referenced by get(), mutablepeek(), setavail(), unalloc(), unallocable(), unget(), ungettable(), used(), and zap().

size_t WvInPlaceBufStore::writeidx [protected]
 

Definition at line 255 of file wvbufstore.h.

Referenced by alloc(), free(), get(), mutablepeek(), setavail(), unalloc(), unallocable(), used(), and zap().

bool WvInPlaceBufStore::xautofree [protected]
 

Definition at line 256 of file wvbufstore.h.

Referenced by autofree(), reset(), setautofree(), and ~WvInPlaceBufStore().

size_t WvInPlaceBufStore::xsize [protected]
 

Definition at line 253 of file wvbufstore.h.

Referenced by alloc(), free(), reset(), setavail(), and size().


The documentation for this class was generated from the following files:
Generated on Sat Feb 21 21:06:28 2004 for WvStreams by doxygen 1.3.5