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

WvDynBufStore Class Reference

#include <wvbufstore.h>

Inherits WvLinkedBufferStore.

Collaboration diagram for WvDynBufStore:

[legend]
List of all members.

Detailed Description

The WvDynBuf storage class.

Definition at line 478 of file wvbufstore.h.

Public Member Functions

 WvDynBufStore (size_t _granularity, size_t _minalloc, size_t _maxalloc)
virtual size_t free () const
virtual size_t optallocable () const
virtual void * alloc (size_t count)
virtual size_t used () const
virtual size_t optgettable () const
virtual const void * get (size_t count)
virtual void unget (size_t count)
virtual size_t ungettable () const
virtual void zap ()
virtual void unalloc (size_t count)
virtual size_t unallocable () const
virtual size_t optpeekable (int offset) const
virtual void * mutablepeek (int offset, size_t count)
virtual bool isreadable () const
virtual void skip (size_t count)
virtual size_t peekable (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
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 WvBufStorenewbuffer (size_t minsize)
 Called when a new buffer must be allocated to coalesce chunks.

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.

virtual void recyclebuffer (WvBufStore *buffer)
 Called when a buffer with autofree is removed from the list.

int search (WvBufStoreList::Iter &it, int offset) const
 Searches for the buffer containing the offset.

WvBufStorecoalesce (WvBufStoreList::Iter &it, size_t count)
 Coalesces a sequence of buffers.


Protected Attributes

WvBufStoreList list
size_t totalused
size_t maxungettable
int granularity


Constructor & Destructor Documentation

WvDynBufStore::WvDynBufStore size_t  _granularity,
size_t  _minalloc,
size_t  _maxalloc
 

Definition at line 1122 of file wvbufferstore.cc.

References WvDynBufStore().

Referenced by WvDynBufStore().


Member Function Documentation

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

Reimplemented from WvLinkedBufferStore.

Definition at line 1146 of file wvbufferstore.cc.

References alloc(), WvLinkedBufferStore::free(), and newbuffer().

Referenced by alloc().

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

Appends a subbuffer to the buffer.

Reimplemented from WvBufStore.

Definition at line 763 of file wvbufferstore.cc.

References WvLinkedBufferStore::appendsubbuffer(), WvLinkedBufferStore::list, WvLinkedBufferStore::totalused, and WvBufStore::used().

Referenced by WvLinkedBufferStore::appendsubbuffer().

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

Definition at line 229 of file wvbufferstore.cc.

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

Referenced by WvBufStore::basicmerge(), and WvBufStore::merge().

WvBufStore * WvLinkedBufferStore::coalesce WvBufStoreList::Iter &  it,
size_t  count
[protected, inherited]
 

Coalesces a sequence of buffers.

"it" is the iterator pointing to the first buffer "count" is the required number of contiguous used bytes Returns: the composite buffer

Definition at line 1042 of file wvbufferstore.cc.

References WvBufStore::alloc(), WvLinkedBufferStore::coalesce(), WvBufStore::free(), WvLinkedBufferStore::list, WvBufStore::merge(), WvLinkedBufferStore::newbuffer(), WvBufStore::skip(), WvLinkedBufferStore::totalused, WvBufStore::unget(), WvBufStore::ungettable(), WvLinkedBufferStore::ungettable(), and WvBufStore::used().

Referenced by WvLinkedBufferStore::coalesce(), WvLinkedBufferStore::get(), and WvLinkedBufferStore::mutablepeek().

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

Definition at line 128 of file wvbufferstore.cc.

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

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

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

Definition at line 163 of file wvbufferstore.cc.

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

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

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

Returns the first subbuffer.

Returns: the buffer or NULL if none or not supported

Reimplemented from WvBufStore.

Definition at line 757 of file wvbufferstore.cc.

References WvLinkedBufferStore::list.

size_t WvDynBufStore::free  )  const [virtual]
 

Reimplemented from WvLinkedBufferStore.

Definition at line 1131 of file wvbufferstore.cc.

References UNLIMITED_FREE_SPACE.

const void * WvLinkedBufferStore::get size_t  count  )  [virtual, inherited]
 

Implements WvBufStore.

Definition at line 817 of file wvbufferstore.cc.

References WvLinkedBufferStore::coalesce(), WvBufStore::get(), WvLinkedBufferStore::get(), WvLinkedBufferStore::list, WvLinkedBufferStore::maxungettable, WvLinkedBufferStore::totalused, and WvBufStore::used().

Referenced by WvLinkedBufferStore::get().

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::merge(), WvBufStore::unlinksubbuffer(), WvBufStore::used(), and WvBufStore::usessubbuffers().

Referenced by WvLinkedBufferStore::coalesce(), WvBufStore::merge(), 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, WvBufStore::move(), and WvBufStore::optgettable().

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

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

Implements WvBufStore.

Definition at line 977 of file wvbufferstore.cc.

References WvLinkedBufferStore::coalesce(), WvLinkedBufferStore::list, WvBufStore::mutablepeek(), WvLinkedBufferStore::mutablepeek(), WvBufStore::peekable(), and WvLinkedBufferStore::search().

Referenced by WvLinkedBufferStore::mutablepeek().

WvBufStore * WvDynBufStore::newbuffer size_t  minsize  )  [protected, virtual]
 

Called when a new buffer must be allocated to coalesce chunks.

"minsize" is the minimum size for the new buffer Returns: the new buffer

Reimplemented from WvLinkedBufferStore.

Definition at line 1157 of file wvbufferstore.cc.

References newbuffer(), and WvLinkedBufferStore::used().

Referenced by alloc(), and newbuffer().

size_t WvLinkedBufferStore::numsubbuffers  )  const [protected, virtual, inherited]
 

Returns the number of subbuffers in the buffer.

Reimplemented from WvBufStore.

Definition at line 751 of file wvbufferstore.cc.

References WvLinkedBufferStore::list.

size_t WvDynBufStore::optallocable  )  const [virtual]
 

Reimplemented from WvLinkedBufferStore.

Definition at line 1137 of file wvbufferstore.cc.

References WvLinkedBufferStore::optallocable(), and UNLIMITED_FREE_SPACE.

size_t WvLinkedBufferStore::optgettable  )  const [virtual, inherited]
 

Reimplemented from WvBufStore.

Definition at line 805 of file wvbufferstore.cc.

References WvLinkedBufferStore::list.

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

Reimplemented from WvBufStore.

Definition at line 965 of file wvbufferstore.cc.

References WvLinkedBufferStore::list, WvBufStore::optpeekable(), WvLinkedBufferStore::optpeekable(), and WvLinkedBufferStore::search().

Referenced by WvLinkedBufferStore::optpeekable().

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(), and WvBufStore::peek().

Referenced by WvBufStore::copy(), WvBufCursorStore::get(), WvBufStore::peek(), 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::peekable(), WvBufStore::ungettable(), and WvBufStore::used().

Referenced by WvLinkedBufferStore::mutablepeek(), WvBufStore::optpeekable(), WvBufBaseCommonImpl< unsigned >::optpeekable(), WvBufStore::peekable(), 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::poke(), WvBufStore::put(), and WvBufStore::used().

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

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

Prepends a subbuffer to the buffer.

Reimplemented from WvBufStore.

Definition at line 771 of file wvbufferstore.cc.

References WvLinkedBufferStore::list, WvLinkedBufferStore::maxungettable, WvLinkedBufferStore::prependsubbuffer(), WvLinkedBufferStore::totalused, and WvBufStore::used().

Referenced by WvLinkedBufferStore::prependsubbuffer().

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

Definition at line 146 of file wvbufferstore.cc.

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

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

void WvLinkedBufferStore::recyclebuffer WvBufStore buffer  )  [protected, virtual, inherited]
 

Called when a buffer with autofree is removed from the list.

This function is not called during object destruction.

"buffer" is the buffer to be destroyed

Definition at line 1004 of file wvbufferstore.cc.

References WvLinkedBufferStore::recyclebuffer().

Referenced by WvLinkedBufferStore::recyclebuffer().

int WvLinkedBufferStore::search WvBufStoreList::Iter &  it,
int  offset
const [protected, inherited]
 

Searches for the buffer containing the offset.

"it" is the iterator updated to point to buffer found, or to an invalid region if the offset is invalid "offset" is the offset for which to search Returns: the corrected offset within the buffer at it.ptr()

Definition at line 1010 of file wvbufferstore.cc.

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

Referenced by WvLinkedBufferStore::mutablepeek(), WvLinkedBufferStore::optpeekable(), and WvLinkedBufferStore::search().

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

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

void WvLinkedBufferStore::unalloc size_t  count  )  [virtual, inherited]
 

Implements WvBufStore.

Definition at line 932 of file wvbufferstore.cc.

References WvLinkedBufferStore::list, WvLinkedBufferStore::totalused, WvBufStore::unalloc(), WvLinkedBufferStore::unalloc(), and WvBufStore::unallocable().

Referenced by WvLinkedBufferStore::unalloc().

size_t WvLinkedBufferStore::unallocable  )  const [virtual, inherited]
 

Implements WvBufStore.

Definition at line 959 of file wvbufferstore.cc.

References WvLinkedBufferStore::totalused.

void WvLinkedBufferStore::unget size_t  count  )  [virtual, inherited]
 

Implements WvBufStore.

Definition at line 858 of file wvbufferstore.cc.

References WvLinkedBufferStore::list, WvLinkedBufferStore::maxungettable, WvLinkedBufferStore::totalused, and WvLinkedBufferStore::unget().

Referenced by WvLinkedBufferStore::unget().

size_t WvLinkedBufferStore::ungettable  )  const [virtual, inherited]
 

Implements WvBufStore.

Definition at line 872 of file wvbufferstore.cc.

References WvLinkedBufferStore::list, WvLinkedBufferStore::maxungettable, and WvLinkedBufferStore::totalused.

Referenced by WvLinkedBufferStore::coalesce().

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

Unlinks the specified subbuffer.

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

Reimplemented from WvBufStore.

Definition at line 780 of file wvbufferstore.cc.

References WvLinkedBufferStore::list, WvLinkedBufferStore::maxungettable, WvLinkedBufferStore::totalused, WvLinkedBufferStore::unlinksubbuffer(), and WvBufStore::used().

Referenced by WvLinkedBufferStore::unlinksubbuffer().

size_t WvLinkedBufferStore::used  )  const [virtual, inherited]
 

Implements WvBufStore.

Definition at line 798 of file wvbufferstore.cc.

References WvLinkedBufferStore::list, and WvLinkedBufferStore::totalused.

Referenced by newbuffer().

bool WvLinkedBufferStore::usessubbuffers  )  const [protected, virtual, inherited]
 

Returns true if the buffer uses subbuffers for storage.

Reimplemented from WvBufStore.

Definition at line 745 of file wvbufferstore.cc.

void WvLinkedBufferStore::zap  )  [virtual, inherited]
 

Implements WvBufStore.

Definition at line 896 of file wvbufferstore.cc.

References WvLinkedBufferStore::list, WvLinkedBufferStore::maxungettable, and WvLinkedBufferStore::totalused.


Member Data Documentation

int WvBufStore::granularity [protected, inherited]
 

Definition at line 31 of file wvbufstore.h.

WvBufStoreList WvLinkedBufferStore::list [protected, inherited]
 

Definition at line 402 of file wvbufstore.h.

Referenced by WvLinkedBufferStore::alloc(), WvLinkedBufferStore::appendsubbuffer(), WvLinkedBufferStore::coalesce(), WvLinkedBufferStore::firstsubbuffer(), WvLinkedBufferStore::free(), WvLinkedBufferStore::get(), WvLinkedBufferStore::mutablepeek(), WvLinkedBufferStore::numsubbuffers(), WvLinkedBufferStore::optallocable(), WvLinkedBufferStore::optgettable(), WvLinkedBufferStore::optpeekable(), WvLinkedBufferStore::prependsubbuffer(), WvLinkedBufferStore::unalloc(), WvLinkedBufferStore::unget(), WvLinkedBufferStore::ungettable(), WvLinkedBufferStore::unlinksubbuffer(), WvLinkedBufferStore::used(), and WvLinkedBufferStore::zap().

size_t WvLinkedBufferStore::maxungettable [protected, inherited]
 

Definition at line 404 of file wvbufstore.h.

Referenced by WvLinkedBufferStore::get(), WvLinkedBufferStore::prependsubbuffer(), WvLinkedBufferStore::unget(), WvLinkedBufferStore::ungettable(), WvLinkedBufferStore::unlinksubbuffer(), and WvLinkedBufferStore::zap().

size_t WvLinkedBufferStore::totalused [protected, inherited]
 

Definition at line 403 of file wvbufstore.h.

Referenced by WvLinkedBufferStore::alloc(), WvLinkedBufferStore::appendsubbuffer(), WvLinkedBufferStore::coalesce(), WvLinkedBufferStore::get(), WvLinkedBufferStore::prependsubbuffer(), WvLinkedBufferStore::unalloc(), WvLinkedBufferStore::unallocable(), WvLinkedBufferStore::unget(), WvLinkedBufferStore::ungettable(), WvLinkedBufferStore::unlinksubbuffer(), WvLinkedBufferStore::used(), and WvLinkedBufferStore::zap().


The documentation for this class was generated from the following files:
Generated on Tue Oct 5 01:09:25 2004 for WvStreams by doxygen 1.3.7