In file ../include/EST_TBuffer.h:

## template<class TYPE> class EST_TBuffer

> Extending buffer class.

### Public Methods

  | EST_TBuffer (unsigned int size=TBUFFER_DEFAULT_SIZE, int step=TBUFFER_DEFAULT_STEP) Create with size and increment.
  | ~EST_TBuffer (void) Destructor.
  unsigned int | length (void) const Current available space
  void | set (const TYPE &set_to, int howmany=-1) Set to the given value.
  | Methods to make sure there is enough space.
  void | ensure (unsigned int req_size) Extend if needed, copying existing data
  void | ensure (unsigned int req_size, bool copy) Make sure there is enough space, copying if requested
  void | ensure (unsigned int req_size, const TYPE &set_to, int howmany=-1) Make sure there is enough space, setting to a known value
  | Access to the memory itself.
  TYPE* | b (void) Simple access as a pointer
  const TYPE* | b (void) const Read-only access when the EST_TBuffer is a constant
  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.

`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

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

`unsigned int length(void) const`
  Current available space

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

`Methods to make sure there is enough space.`

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

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

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

`Access to the memory itself.`

`TYPE* b(void)`
  Simple access as a pointer

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

`const 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