Package PyFoam :: Package Basics :: Module RingBuffer :: Class RingBuffer
[show private | hide private]
[frames | no frames]

Class RingBuffer


A data structure that stores a number N of elements. The N+1-element overwrites the first and so on ....
Method Summary
  __init__(self, nr)
  dump(self)
Return a list with all the values in the ring buffer in the correct order (starting with the oldest)
  insert(self, dings)
Inserts am element into the ring-buffer
  last(self)
Return the latest element in the buffer, None if nothing was inserted into the buffer

Method Details

__init__(self, nr=1000)
(Constructor)

Parameters:
nr - Number of elements to store

dump(self)

Returns:
A list with all the values in the ring buffer in the correct order (starting with the oldest)

insert(self, dings)

Inserts am element into the ring-buffer

last(self)

Returns:
the latest element in the buffer, None if nothing was inserted into the buffer

Generated by Epydoc 2.1 on Mon Jan 22 23:52:48 2007 http://epydoc.sf.net