WvStreams
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
WvBufStore Class Referenceabstract

The abstract buffer storage base class. More...

#include <wvbufstore.h>

Inheritance diagram for WvBufStore:
Inheritance graph
[legend]

Public Member Functions

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

Detailed Description

The abstract buffer storage base class.

Definition at line 26 of file debian/libwvstreams-dev/usr/include/wvstreams/wvbufstore.h.

Constructor & Destructor Documentation

◆ WvBufStore() [1/2]

WvBufStore::WvBufStore ( int  _granularity)
explicitprotected

Creates a new buffer.

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

Definition at line 84 of file wvbufferstore.cc.

◆ ~WvBufStore() [1/2]

virtual WvBufStore::~WvBufStore ( )
inlinevirtual

◆ WvBufStore() [2/2]

WvBufStore::WvBufStore ( int  _granularity)
explicitprotected

Creates a new buffer.

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

◆ ~WvBufStore() [2/2]

virtual WvBufStore::~WvBufStore ( )
inlinevirtual

Definition at line 43 of file include/wvbufstore.h.

Member Function Documentation

◆ isreadable() [1/2]

virtual bool WvBufStore::isreadable ( ) const
inlinevirtual

◆ optgettable() [1/2]

virtual size_t WvBufStore::optgettable ( ) const
inlinevirtual

◆ skip() [1/2]

virtual void WvBufStore::skip ( size_t  count)
inlinevirtual

◆ peekable()

size_t WvBufStore::peekable ( int  offset) const
virtual

Definition at line 90 of file wvbufferstore.cc.

◆ optpeekable() [1/2]

virtual size_t WvBufStore::optpeekable ( int  offset) const
inlinevirtual

◆ peek() [1/2]

virtual const void * WvBufStore::peek ( int  offset,
size_t  count 
)
inlinevirtual

◆ move()

void WvBufStore::move ( void *  buf,
size_t  count 
)

Definition at line 111 of file wvbufferstore.cc.

◆ copy()

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

Definition at line 128 of file wvbufferstore.cc.

◆ iswritable() [1/2]

virtual bool WvBufStore::iswritable ( ) const
inlinevirtual

◆ optallocable() [1/2]

virtual size_t WvBufStore::optallocable ( ) const
inlinevirtual

◆ put()

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

Definition at line 146 of file wvbufferstore.cc.

◆ fastput()

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

Definition at line 163 of file wvbufferstore.cc.

◆ poke()

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

Definition at line 170 of file wvbufferstore.cc.

◆ merge()

void WvBufStore::merge ( WvBufStore instore,
size_t  count 
)
virtual

Definition at line 198 of file wvbufferstore.cc.

◆ basicmerge()

void WvBufStore::basicmerge ( WvBufStore instore,
size_t  count 
)

Definition at line 229 of file wvbufferstore.cc.

◆ usessubbuffers() [1/2]

virtual bool WvBufStore::usessubbuffers ( ) const
inlineprotectedvirtual

Returns true if the buffer uses subbuffers for storage.

Reimplemented in WvLinkedBufferStore, and WvLinkedBufferStore.

Definition at line 96 of file debian/libwvstreams-dev/usr/include/wvstreams/wvbufstore.h.

◆ numsubbuffers() [1/2]

virtual size_t WvBufStore::numsubbuffers ( ) const
inlineprotectedvirtual

Returns the number of subbuffers in the buffer.

Reimplemented in WvLinkedBufferStore, and WvLinkedBufferStore.

Definition at line 100 of file debian/libwvstreams-dev/usr/include/wvstreams/wvbufstore.h.

◆ firstsubbuffer() [1/2]

virtual WvBufStore * WvBufStore::firstsubbuffer ( ) const
inlineprotectedvirtual

Returns the first subbuffer.

Returns: the buffer or NULL if none or not supported

Reimplemented in WvLinkedBufferStore, and WvLinkedBufferStore.

Definition at line 107 of file debian/libwvstreams-dev/usr/include/wvstreams/wvbufstore.h.

◆ appendsubbuffer() [1/2]

virtual void WvBufStore::appendsubbuffer ( WvBufStore buffer,
bool  autofree 
)
inlineprotectedvirtual

Appends a subbuffer to the buffer.

Reimplemented in WvLinkedBufferStore, and WvLinkedBufferStore.

Definition at line 111 of file debian/libwvstreams-dev/usr/include/wvstreams/wvbufstore.h.

◆ prependsubbuffer() [1/2]

virtual void WvBufStore::prependsubbuffer ( WvBufStore buffer,
bool  autofree 
)
inlineprotectedvirtual

Prepends a subbuffer to the buffer.

Reimplemented in WvLinkedBufferStore, and WvLinkedBufferStore.

Definition at line 115 of file debian/libwvstreams-dev/usr/include/wvstreams/wvbufstore.h.

◆ unlinksubbuffer() [1/2]

virtual bool WvBufStore::unlinksubbuffer ( WvBufStore buffer,
bool  allowautofree 
)
inlineprotectedvirtual

Unlinks the specified subbuffer.

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

Reimplemented in WvLinkedBufferStore, and WvLinkedBufferStore.

Definition at line 123 of file debian/libwvstreams-dev/usr/include/wvstreams/wvbufstore.h.

◆ isreadable() [2/2]

virtual bool WvBufStore::isreadable ( ) const
inlinevirtual

Definition at line 47 of file include/wvbufstore.h.

◆ optgettable() [2/2]

virtual size_t WvBufStore::optgettable ( ) const
inlinevirtual

Definition at line 50 of file include/wvbufstore.h.

◆ skip() [2/2]

virtual void WvBufStore::skip ( size_t  count)
inlinevirtual

Definition at line 53 of file include/wvbufstore.h.

◆ optpeekable() [2/2]

virtual size_t WvBufStore::optpeekable ( int  offset) const
inlinevirtual

Definition at line 58 of file include/wvbufstore.h.

◆ peek() [2/2]

virtual const void * WvBufStore::peek ( int  offset,
size_t  count 
)
inlinevirtual

Definition at line 60 of file include/wvbufstore.h.

◆ iswritable() [2/2]

virtual bool WvBufStore::iswritable ( ) const
inlinevirtual

Definition at line 70 of file include/wvbufstore.h.

◆ optallocable() [2/2]

virtual size_t WvBufStore::optallocable ( ) const
inlinevirtual

Definition at line 73 of file include/wvbufstore.h.

◆ usessubbuffers() [2/2]

virtual bool WvBufStore::usessubbuffers ( ) const
inlineprotectedvirtual

Returns true if the buffer uses subbuffers for storage.

Reimplemented in WvLinkedBufferStore, and WvLinkedBufferStore.

Definition at line 96 of file include/wvbufstore.h.

◆ numsubbuffers() [2/2]

virtual size_t WvBufStore::numsubbuffers ( ) const
inlineprotectedvirtual

Returns the number of subbuffers in the buffer.

Reimplemented in WvLinkedBufferStore, and WvLinkedBufferStore.

Definition at line 100 of file include/wvbufstore.h.

◆ firstsubbuffer() [2/2]

virtual WvBufStore * WvBufStore::firstsubbuffer ( ) const
inlineprotectedvirtual

Returns the first subbuffer.

Returns: the buffer or NULL if none or not supported

Reimplemented in WvLinkedBufferStore, and WvLinkedBufferStore.

Definition at line 107 of file include/wvbufstore.h.

◆ appendsubbuffer() [2/2]

virtual void WvBufStore::appendsubbuffer ( WvBufStore buffer,
bool  autofree 
)
inlineprotectedvirtual

Appends a subbuffer to the buffer.

Reimplemented in WvLinkedBufferStore, and WvLinkedBufferStore.

Definition at line 111 of file include/wvbufstore.h.

◆ prependsubbuffer() [2/2]

virtual void WvBufStore::prependsubbuffer ( WvBufStore buffer,
bool  autofree 
)
inlineprotectedvirtual

Prepends a subbuffer to the buffer.

Reimplemented in WvLinkedBufferStore, and WvLinkedBufferStore.

Definition at line 115 of file include/wvbufstore.h.

◆ unlinksubbuffer() [2/2]

virtual bool WvBufStore::unlinksubbuffer ( WvBufStore buffer,
bool  allowautofree 
)
inlineprotectedvirtual

Unlinks the specified subbuffer.

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

Reimplemented in WvLinkedBufferStore, and WvLinkedBufferStore.

Definition at line 123 of file include/wvbufstore.h.

Member Data Documentation

◆ granularity

int WvBufStore::granularity
protected

The documentation for this class was generated from the following files: