#include <wvbufstore.h>
Inherits WvBufStore.
Inherited by WvDynBufStore.
Collaboration diagram for WvLinkedBufferStore:
A buffer store built out of a list of other buffers linked together. Buffers may be appended or prepended to the list at any time, at which point they act as slaves for the master buffer. Slaves may be expunged from the list at any time when the master buffer determines that they are of no further use.
This is mostly useful for building other buffer storage classes.
Definition at line 399 of file wvbufstore.h.
Public Member Functions | |
WvLinkedBufferStore (int _granularity) | |
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 size_t | free () const |
virtual size_t | optallocable () const |
virtual void * | alloc (size_t count) |
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 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 WvBufStore * | firstsubbuffer () 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 WvBufStore * | newbuffer (size_t minsize) |
Called when a new buffer must be allocated to coalesce chunks. | |
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. | |
WvBufStore * | coalesce (WvBufStoreList::Iter &it, size_t count) |
Coalesces a sequence of buffers. | |
Protected Attributes | |
WvBufStoreList | list |
size_t | totalused |
size_t | maxungettable |
int | granularity |
|
Definition at line 739 of file wvbufferstore.cc. |
|
Implements WvBufStore. Reimplemented in WvDynBufStore. Definition at line 922 of file wvbufferstore.cc. References WvBufStore::alloc(), list, and totalused. Referenced by WvDynBufStore::alloc(). |
|
Appends a subbuffer to the buffer.
Reimplemented from WvBufStore. Definition at line 763 of file wvbufferstore.cc. References list, totalused, and WvBufStore::used(). Referenced by WvDynBufStore::alloc(). |
|
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(). |
|
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(), WvBufStore::free(), list, WvBufStore::merge(), newbuffer(), WvBufStore::skip(), totalused, WvBufStore::unget(), WvBufStore::ungettable(), ungettable(), and WvBufStore::used(). Referenced by get(), and mutablepeek(). |
|
Definition at line 128 of file wvbufferstore.cc. References memops, WvBufStore::optpeekable(), and WvBufStore::peek(). Referenced by WvBufBaseCommonImpl< unsigned char >::copy(). |
|
Definition at line 163 of file wvbufferstore.cc. References WvBufStore::alloc(), and memops. Referenced by WvBufBaseCommonImpl< unsigned char >::put(). |
|
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 list. |
|
Implements WvBufStore. Reimplemented in WvDynBufStore. Definition at line 906 of file wvbufferstore.cc. References WvBufStore::free(), and list. Referenced by WvDynBufStore::alloc(). |
|
Implements WvBufStore. Definition at line 817 of file wvbufferstore.cc. References coalesce(), WvBufStore::get(), list, maxungettable, totalused, and WvBufStore::used(). |
|
Reimplemented in WvBufCursorStore, and WvWriteOnlyBufferStoreMixin< WvReadOnlyBufferStoreMixin< WvBufStore > >. Definition at line 45 of file wvbufstore.h. Referenced by WvBufCursorStore::isreadable(), and WvBufBaseCommonImpl< unsigned char >::isreadable(). |
|
Reimplemented in WvBufCursorStore, and WvReadOnlyBufferStoreMixin< WvBufStore >. Definition at line 68 of file wvbufstore.h. Referenced by WvBufCursorStore::iswritable(). |
|
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 coalesce(), and WvBufBaseCommonImpl< unsigned char >::merge(). |
|
Definition at line 111 of file wvbufferstore.cc. References WvBufStore::get(), memops, and WvBufStore::optgettable(). Referenced by WvBufBaseCommonImpl< unsigned char >::move(). |
|
Implements WvBufStore. Definition at line 977 of file wvbufferstore.cc. References coalesce(), list, WvBufStore::mutablepeek(), WvBufStore::peekable(), and search(). |
|
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 in WvDynBufStore. Definition at line 996 of file wvbufferstore.cc. References roundup(). Referenced by coalesce(), and WvDynBufStore::newbuffer(). |
|
Returns the number of subbuffers in the buffer.
Reimplemented from WvBufStore. Definition at line 751 of file wvbufferstore.cc. References list. |
|
Reimplemented from WvBufStore. Reimplemented in WvDynBufStore. Definition at line 914 of file wvbufferstore.cc. References list, and WvBufStore::optallocable(). Referenced by WvDynBufStore::optallocable(). |
|
Reimplemented from WvBufStore. Definition at line 805 of file wvbufferstore.cc. References list. |
|
Reimplemented from WvBufStore. Definition at line 965 of file wvbufferstore.cc. References list, WvBufStore::optpeekable(), and search(). |
|
Reimplemented in WvConstInPlaceBufStore, WvBufCursorStore, and WvWriteOnlyBufferStoreMixin< WvReadOnlyBufferStoreMixin< WvBufStore > >. Definition at line 58 of file wvbufstore.h. Referenced by WvBufStore::copy(), WvBufCursorStore::get(), WvBufCursorStore::peek(), and WvBufBaseCommonImpl< unsigned char >::peek(). |
|
Reimplemented in WvBufCursorStore, and WvWriteOnlyBufferStoreMixin< WvReadOnlyBufferStoreMixin< WvBufStore > >. Definition at line 90 of file wvbufferstore.cc. References WvBufStore::ungettable(), and WvBufStore::used(). Referenced by mutablepeek(), WvBufBaseCommonImpl< unsigned char >::optpeekable(), and WvBufBaseCommonImpl< unsigned char >::peekable(). |
|
Definition at line 170 of file wvbufferstore.cc. References memops, WvBufStore::mutablepeek(), WvBufStore::optpeekable(), WvBufStore::put(), and WvBufStore::used(). Referenced by WvBufBaseCommonImpl< unsigned char >::poke(). |
|
Prepends a subbuffer to the buffer.
Reimplemented from WvBufStore. Definition at line 771 of file wvbufferstore.cc. References list, maxungettable, totalused, and WvBufStore::used(). |
|
Definition at line 146 of file wvbufferstore.cc. References WvBufStore::alloc(), memops, and WvBufStore::optallocable(). Referenced by WvBufStore::poke(), and WvBufBaseCommonImpl< unsigned char >::put(). |
|
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. |
|
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 WvBufStore::ungettable(), and WvBufStore::used(). Referenced by mutablepeek(), and optpeekable(). |
|
Reimplemented in WvBufCursorStore, and WvWriteOnlyBufferStoreMixin< WvReadOnlyBufferStoreMixin< WvBufStore > >. Definition at line 51 of file wvbufstore.h. Referenced by coalesce(), and WvBufBaseCommonImpl< unsigned char >::skip(). |
|
Implements WvBufStore. Definition at line 932 of file wvbufferstore.cc. References list, totalused, WvBufStore::unalloc(), and WvBufStore::unallocable(). |
|
Implements WvBufStore. Definition at line 959 of file wvbufferstore.cc. |
|
Implements WvBufStore. Definition at line 858 of file wvbufferstore.cc. References list, maxungettable, totalused, and WvBufStore::unget(). |
|
Implements WvBufStore. Definition at line 872 of file wvbufferstore.cc. References list, maxungettable, totalused, and WvBufStore::ungettable(). Referenced by coalesce(). |
|
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 list, maxungettable, totalused, and WvBufStore::used(). |
|
Implements WvBufStore. Definition at line 798 of file wvbufferstore.cc. References list, and totalused. Referenced by WvDynBufStore::newbuffer(). |
|
Returns true if the buffer uses subbuffers for storage.
Reimplemented from WvBufStore. Definition at line 745 of file wvbufferstore.cc. |
|
Implements WvBufStore. Definition at line 896 of file wvbufferstore.cc. References list, maxungettable, and totalused. |
|
Definition at line 31 of file wvbufstore.h. |
|
Definition at line 402 of file wvbufstore.h. Referenced by alloc(), appendsubbuffer(), coalesce(), firstsubbuffer(), free(), get(), mutablepeek(), numsubbuffers(), optallocable(), optgettable(), optpeekable(), prependsubbuffer(), unalloc(), unget(), ungettable(), unlinksubbuffer(), used(), and zap(). |
|
Definition at line 404 of file wvbufstore.h. Referenced by get(), prependsubbuffer(), unget(), ungettable(), unlinksubbuffer(), and zap(). |
|
Definition at line 403 of file wvbufstore.h. Referenced by alloc(), appendsubbuffer(), coalesce(), get(), prependsubbuffer(), unalloc(), unget(), ungettable(), unlinksubbuffer(), used(), and zap(). |