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

WvBufStore Class Reference

#include <wvbufstore.h>

Inherited by WvCircularBufStore, WvInPlaceBufStore, WvLinkedBufferStore, and WvReadOnlyBufferStoreMixin< WvBufStore >.

Collaboration diagram for WvBufStore:

[legend]
List of all members.

Detailed Description

The abstract buffer storage base class.

Definition at line 24 of file wvbufstore.h.

Public Member Functions

virtual ~WvBufStore ()
virtual bool isreadable () const
virtual size_t used () const=0
virtual size_t optgettable () const
virtual const void * get (size_t count)=0
virtual void skip (size_t count)
virtual void unget (size_t count)=0
virtual size_t ungettable () const=0
virtual size_t peekable (int offset) const
virtual size_t optpeekable (int offset) const
virtual const void * peek (int offset, size_t count)
virtual void zap ()=0
void move (void *buf, size_t count)
void copy (void *buf, int offset, size_t count)
virtual bool iswritable () const
virtual size_t free () const=0
virtual size_t optallocable () const
virtual void * alloc (size_t count)=0
virtual void unalloc (size_t count)=0
virtual size_t unallocable () const=0
virtual void * mutablepeek (int offset, size_t count)=0
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

 WvBufStore (int _granularity)
 Creates a new buffer.

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

int granularity


Constructor & Destructor Documentation

WvBufStore::WvBufStore int  _granularity  )  [explicit, protected]
 

Creates a new buffer.

"_granularity" is the suggested granularity for data allocation and alignment purposes

Definition at line 84 of file wvbufferstore.cc.

virtual WvBufStore::~WvBufStore  )  [inline, virtual]
 

Definition at line 41 of file wvbufstore.h.


Member Function Documentation

virtual void* WvBufStore::alloc size_t  count  )  [pure virtual]
 

Implemented in WvInPlaceBufStore, WvCircularBufStore, WvLinkedBufferStore, WvDynBufStore, and WvReadOnlyBufferStoreMixin< WvBufStore >.

Referenced by WvBufBaseCommonImpl< unsigned >::alloc(), basicmerge(), WvLinkedBufferStore::coalesce(), fastput(), and put().

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

Appends a subbuffer to the buffer.

Reimplemented in WvLinkedBufferStore.

Definition at line 109 of file wvbufstore.h.

Referenced by merge().

void WvBufStore::basicmerge WvBufStore instore,
size_t  count
 

Definition at line 229 of file wvbufferstore.cc.

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

Referenced by merge().

void WvBufStore::copy void *  buf,
int  offset,
size_t  count
 

Definition at line 128 of file wvbufferstore.cc.

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

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

void WvBufStore::fastput const void *  data,
size_t  count
 

Definition at line 163 of file wvbufferstore.cc.

References alloc(), and memops.

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

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

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

virtual size_t WvBufStore::free  )  const [pure virtual]
 

Implemented in WvInPlaceBufStore, WvCircularBufStore, WvLinkedBufferStore, WvDynBufStore, and WvReadOnlyBufferStoreMixin< WvBufStore >.

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

virtual const void* WvBufStore::get size_t  count  )  [pure virtual]
 

Implemented in WvInPlaceBufStore, WvConstInPlaceBufStore, WvCircularBufStore, WvLinkedBufferStore, WvBufCursorStore, and WvWriteOnlyBufferStoreMixin< WvReadOnlyBufferStoreMixin< WvBufStore > >.

Referenced by basicmerge(), WvLinkedBufferStore::get(), WvBufBaseCommonImpl< unsigned >::get(), move(), and skip().

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

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]
 

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]
 

Reimplemented in WvReadOnlyBufferStoreMixin< WvBufStore >.

Definition at line 198 of file wvbufferstore.cc.

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

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

void WvBufStore::move void *  buf,
size_t  count
 

Definition at line 111 of file wvbufferstore.cc.

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

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

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

Implemented in WvInPlaceBufStore, WvCircularBufStore, WvLinkedBufferStore, WvBufCursorStore, and WvReadOnlyBufferStoreMixin< WvBufStore >.

Referenced by WvBufCursorStore::mutablepeek(), WvLinkedBufferStore::mutablepeek(), WvBufBaseCommonImpl< unsigned >::mutablepeek(), peek(), and poke().

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

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]
 

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

Definition at line 71 of file wvbufstore.h.

References free().

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

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

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

Definition at line 48 of file wvbufstore.h.

References used().

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

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

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

Definition at line 56 of file wvbufstore.h.

References peekable().

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

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

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

Definition at line 58 of file wvbufstore.h.

References mutablepeek().

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

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

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

Definition at line 90 of file wvbufferstore.cc.

References ungettable(), and used().

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

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

Definition at line 170 of file wvbufferstore.cc.

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

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

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

Prepends a subbuffer to the buffer.

Reimplemented in WvLinkedBufferStore.

Definition at line 113 of file wvbufstore.h.

void WvBufStore::put const void *  data,
size_t  count
 

Definition at line 146 of file wvbufferstore.cc.

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

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

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

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

Definition at line 51 of file wvbufstore.h.

References get().

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

virtual void WvBufStore::unalloc size_t  count  )  [pure virtual]
 

Implemented in WvInPlaceBufStore, WvCircularBufStore, WvLinkedBufferStore, and WvReadOnlyBufferStoreMixin< WvBufStore >.

Referenced by basicmerge(), WvLinkedBufferStore::unalloc(), and WvBufBaseCommonImpl< unsigned >::unalloc().

virtual size_t WvBufStore::unallocable  )  const [pure virtual]
 

Implemented in WvInPlaceBufStore, WvCircularBufStore, WvLinkedBufferStore, and WvReadOnlyBufferStoreMixin< WvBufStore >.

Referenced by WvLinkedBufferStore::unalloc(), and WvBufBaseCommonImpl< unsigned >::unallocable().

virtual void WvBufStore::unget size_t  count  )  [pure virtual]
 

Implemented in WvInPlaceBufStore, WvConstInPlaceBufStore, WvCircularBufStore, WvLinkedBufferStore, WvBufCursorStore, and WvWriteOnlyBufferStoreMixin< WvReadOnlyBufferStoreMixin< WvBufStore > >.

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

virtual size_t WvBufStore::ungettable  )  const [pure virtual]
 

Implemented in WvInPlaceBufStore, WvConstInPlaceBufStore, WvCircularBufStore, WvLinkedBufferStore, WvBufCursorStore, and WvWriteOnlyBufferStoreMixin< WvReadOnlyBufferStoreMixin< WvBufStore > >.

Referenced by WvLinkedBufferStore::coalesce(), peekable(), WvLinkedBufferStore::search(), and WvBufBaseCommonImpl< unsigned >::ungettable().

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

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

virtual size_t WvBufStore::used  )  const [pure virtual]
 

Implemented in WvInPlaceBufStore, WvConstInPlaceBufStore, WvCircularBufStore, WvLinkedBufferStore, WvBufCursorStore, and WvWriteOnlyBufferStoreMixin< WvReadOnlyBufferStoreMixin< WvBufStore > >.

Referenced by WvLinkedBufferStore::appendsubbuffer(), WvLinkedBufferStore::coalesce(), WvLinkedBufferStore::get(), merge(), optgettable(), WvBufBaseCommonImpl< unsigned >::optgettable(), peekable(), poke(), WvLinkedBufferStore::prependsubbuffer(), WvLinkedBufferStore::search(), WvLinkedBufferStore::unlinksubbuffer(), and WvBufBaseCommonImpl< unsigned >::used().

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

Returns true if the buffer uses subbuffers for storage.

Reimplemented in WvLinkedBufferStore.

Definition at line 94 of file wvbufstore.h.

Referenced by merge().

virtual void WvBufStore::zap  )  [pure virtual]
 

Implemented in WvInPlaceBufStore, WvConstInPlaceBufStore, WvCircularBufStore, WvLinkedBufferStore, WvBufCursorStore, and WvWriteOnlyBufferStoreMixin< WvReadOnlyBufferStoreMixin< WvBufStore > >.

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


Member Data Documentation

int WvBufStore::granularity [protected]
 

Definition at line 31 of file wvbufstore.h.


The documentation for this class was generated from the following files:
Generated on Sat Mar 13 14:56:58 2004 for WvStreams by doxygen 1.3.6-20040222