In file ../include/EST_TBuffer.h:

template<class TYPE> class EST_TBuffer

Extending buffer class.

Public Methods

[more] EST_TBuffer (unsigned int size=TBUFFER_DEFAULT_SIZE, int step=TBUFFER_DEFAULT_STEP)
Create with size and increment.
[more] ~EST_TBuffer (void)
Destructor.
[more]unsigned int length (void) const
Current available space
[more]void set (const TYPE &set_to, int howmany=-1)
Set to the given value.
[more] Methods to make sure there is enough space.

[more]void ensure (unsigned int req_size)
Extend if needed, copying existing data
[more]void ensure (unsigned int req_size, bool copy)
Make sure there is enough space, copying if requested
[more]void ensure (unsigned int req_size, const TYPE &set_to, int howmany=-1)
Make sure there is enough space, setting to a known value

[more] Access to the memory itself.

[more]TYPE* b (void)
Simple access as a pointer
[more]const TYPE* b (void) const
Read-only access when the EST_TBuffer is a constant
[more]const TYPE& operator() (unsigned int i) const
operator () is simple access


Documentation

Extending buffer class. <p> This class provides the convinience of arrays which change in size at run time rather more efficiantly than the full EST_TVector class would. <p> Buffers can only be expanded and when a buffer is no longer needed (i.e. when the variable goes out of scope) the memory is not deleted, rather it is saved for re-use as a new buffer. <p> A typical use would be a buffer to hold a windowed section of a signal inside a signal processing loop where the size of the window changes from iteration to iteration.

o EST_TBuffer(unsigned int size=TBUFFER_DEFAULT_SIZE, int step=TBUFFER_DEFAULT_STEP)
Create with size and increment. Increment can be negative for percentage growth. <p> Tries to use a buffer from EST_old_buffers[] if there is one which is suitable
See Also:
EST_old_buffers

o ~EST_TBuffer(void)
Destructor. Places the memory in EST_old_buffers[] for re-use if there is room.

ounsigned int length(void) const
Current available space

ovoid set(const TYPE &set_to, int howmany=-1)
Set to the given value. By default sets all values.

o Methods to make sure there is enough space.

ovoid ensure(unsigned int req_size)
Extend if needed, copying existing data

ovoid ensure(unsigned int req_size, bool copy)
Make sure there is enough space, copying if requested

ovoid ensure(unsigned int req_size, const TYPE &set_to, int howmany=-1)
Make sure there is enough space, setting to a known value

o Access to the memory itself.

oTYPE* b(void)
Simple access as a pointer

oconst TYPE* b(void) const
Read-only access when the EST_TBuffer is a constant

oconst TYPE& operator() (unsigned int i) const
operator () is simple access


This class has no child classes.
See Also:
EST_TBuffer.h, Associated definitions.
EST_TVector, class to use for more general uses.
lpc_analyse, example of use.

Alphabetic index HTML hierarchy of classes or Java


This page is part of the Edinburgh Speech Tools Library documentation
Copyright University of Edinburgh 1997
Contact: speech_tools@cstr.ed.ac.uk