WvStreams
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
WvInPlaceBufStore Class Reference

The WvInPlaceBuf storage class. More...

#include <wvbufstore.h>

Inheritance diagram for WvInPlaceBufStore:
Inheritance graph
[legend]

Public Member Functions

 WvInPlaceBufStore (int _granularity, void *_data, size_t _avail, size_t _size, bool _autofree)
 
 WvInPlaceBufStore (int _granularity, size_t _size)
 
void * ptr () const
 
size_t size () const
 
bool get_autofree () const
 
void set_autofree (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. More...
 
virtual size_t numsubbuffers () const
 Returns the number of subbuffers in the buffer. More...
 
virtual WvBufStorefirstsubbuffer () const
 Returns the first subbuffer. More...
 
virtual void appendsubbuffer (WvBufStore *buffer, bool autofree)
 Appends a subbuffer to the buffer. More...
 
virtual void prependsubbuffer (WvBufStore *buffer, bool autofree)
 Prepends a subbuffer to the buffer. More...
 
virtual bool unlinksubbuffer (WvBufStore *buffer, bool allowautofree)
 Unlinks the specified subbuffer. More...
 

Protected Attributes

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

Detailed Description

The WvInPlaceBuf storage class.

Definition at line 251 of file wvbufstore.h.

Constructor & Destructor Documentation

◆ WvInPlaceBufStore() [1/2]

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

Definition at line 287 of file wvbufferstore.cc.

◆ WvInPlaceBufStore() [2/2]

WvInPlaceBufStore::WvInPlaceBufStore ( int  _granularity,
size_t  _size 
)

Definition at line 295 of file wvbufferstore.cc.

◆ ~WvInPlaceBufStore()

WvInPlaceBufStore::~WvInPlaceBufStore ( )
virtual

Definition at line 302 of file wvbufferstore.cc.

Member Function Documentation

◆ ptr()

void * WvInPlaceBufStore::ptr ( ) const
inline

Definition at line 265 of file wvbufstore.h.

◆ size()

size_t WvInPlaceBufStore::size ( ) const
inline

Definition at line 267 of file wvbufstore.h.

◆ get_autofree()

bool WvInPlaceBufStore::get_autofree ( ) const
inline

Definition at line 269 of file wvbufstore.h.

◆ set_autofree()

void WvInPlaceBufStore::set_autofree ( bool  _autofree)
inline

Definition at line 271 of file wvbufstore.h.

◆ reset()

void WvInPlaceBufStore::reset ( void *  _data,
size_t  _avail,
size_t  _size,
bool  _autofree = false 
)

Definition at line 309 of file wvbufferstore.cc.

◆ setavail()

void WvInPlaceBufStore::setavail ( size_t  _avail)

Definition at line 322 of file wvbufferstore.cc.

◆ used()

size_t WvInPlaceBufStore::used ( ) const
virtual

Implements WvBufStore.

Definition at line 330 of file wvbufferstore.cc.

◆ get()

const void * WvInPlaceBufStore::get ( size_t  count)
virtual

Implements WvBufStore.

Definition at line 336 of file wvbufferstore.cc.

◆ unget()

void WvInPlaceBufStore::unget ( size_t  count)
virtual

Implements WvBufStore.

Definition at line 346 of file wvbufferstore.cc.

◆ ungettable()

size_t WvInPlaceBufStore::ungettable ( ) const
virtual

Implements WvBufStore.

Definition at line 354 of file wvbufferstore.cc.

◆ zap()

void WvInPlaceBufStore::zap ( )
virtual

Implements WvBufStore.

Definition at line 360 of file wvbufferstore.cc.

◆ free()

size_t WvInPlaceBufStore::free ( ) const
virtual

Implements WvBufStore.

Definition at line 366 of file wvbufferstore.cc.

◆ alloc()

void * WvInPlaceBufStore::alloc ( size_t  count)
virtual

Implements WvBufStore.

Definition at line 372 of file wvbufferstore.cc.

◆ unalloc()

void WvInPlaceBufStore::unalloc ( size_t  count)
virtual

Implements WvBufStore.

Definition at line 382 of file wvbufferstore.cc.

◆ unallocable()

size_t WvInPlaceBufStore::unallocable ( ) const
virtual

Implements WvBufStore.

Definition at line 390 of file wvbufferstore.cc.

◆ mutablepeek()

void * WvInPlaceBufStore::mutablepeek ( int  offset,
size_t  count 
)
virtual

Implements WvBufStore.

Definition at line 396 of file wvbufferstore.cc.

◆ isreadable()

virtual bool WvBufStore::isreadable ( ) const
inlinevirtualinherited

Definition at line 47 of file wvbufstore.h.

◆ optgettable()

virtual size_t WvBufStore::optgettable ( ) const
inlinevirtualinherited

Definition at line 50 of file wvbufstore.h.

◆ skip()

virtual void WvBufStore::skip ( size_t  count)
inlinevirtualinherited

Definition at line 53 of file wvbufstore.h.

◆ peekable()

size_t WvBufStore::peekable ( int  offset) const
virtualinherited

Definition at line 90 of file wvbufferstore.cc.

◆ optpeekable()

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

Definition at line 58 of file wvbufstore.h.

◆ peek()

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

Definition at line 60 of file wvbufstore.h.

◆ move()

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

Definition at line 111 of file wvbufferstore.cc.

◆ copy()

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

Definition at line 128 of file wvbufferstore.cc.

◆ iswritable()

virtual bool WvBufStore::iswritable ( ) const
inlinevirtualinherited

Definition at line 70 of file wvbufstore.h.

◆ optallocable()

virtual size_t WvBufStore::optallocable ( ) const
inlinevirtualinherited

Definition at line 73 of file wvbufstore.h.

◆ put()

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

Definition at line 146 of file wvbufferstore.cc.

◆ fastput()

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

Definition at line 163 of file wvbufferstore.cc.

◆ poke()

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

Definition at line 170 of file wvbufferstore.cc.

◆ merge()

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

Definition at line 198 of file wvbufferstore.cc.

◆ basicmerge()

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

Definition at line 229 of file wvbufferstore.cc.

◆ usessubbuffers()

virtual bool WvBufStore::usessubbuffers ( ) const
inlineprotectedvirtualinherited

Returns true if the buffer uses subbuffers for storage.

Reimplemented in WvLinkedBufferStore.

Definition at line 96 of file wvbufstore.h.

◆ numsubbuffers()

virtual size_t WvBufStore::numsubbuffers ( ) const
inlineprotectedvirtualinherited

Returns the number of subbuffers in the buffer.

Reimplemented in WvLinkedBufferStore.

Definition at line 100 of file wvbufstore.h.

◆ firstsubbuffer()

virtual WvBufStore * WvBufStore::firstsubbuffer ( ) const
inlineprotectedvirtualinherited

Returns the first subbuffer.

Returns: the buffer or NULL if none or not supported

Reimplemented in WvLinkedBufferStore.

Definition at line 107 of file wvbufstore.h.

◆ appendsubbuffer()

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

Appends a subbuffer to the buffer.

Reimplemented in WvLinkedBufferStore.

Definition at line 111 of file wvbufstore.h.

◆ prependsubbuffer()

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

Prepends a subbuffer to the buffer.

Reimplemented in WvLinkedBufferStore.

Definition at line 115 of file wvbufstore.h.

◆ unlinksubbuffer()

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

Unlinks the specified subbuffer.

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

Reimplemented in WvLinkedBufferStore.

Definition at line 123 of file wvbufstore.h.

Member Data Documentation

◆ data

void* WvInPlaceBufStore::data
protected

Definition at line 254 of file wvbufstore.h.

◆ xsize

size_t WvInPlaceBufStore::xsize
protected

Definition at line 255 of file wvbufstore.h.

◆ readidx

size_t WvInPlaceBufStore::readidx
protected

Definition at line 256 of file wvbufstore.h.

◆ writeidx

size_t WvInPlaceBufStore::writeidx
protected

Definition at line 257 of file wvbufstore.h.

◆ xautofree

bool WvInPlaceBufStore::xautofree
protected

Definition at line 258 of file wvbufstore.h.

◆ granularity

int WvBufStore::granularity
protectedinherited

Definition at line 33 of file wvbufstore.h.


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