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

Class RingBuffer

source code

object --+
         |
        RingBuffer

A data structure that stores a number N of elements. The N+1-element overwrites the first and so on ....

Instance Methods [hide private]
  __init__(self, nr=1000)
  insert(self, dings)
Inserts am element into the ring-buffer
  last(self)
  dump(self)

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__


Properties [hide private]

Inherited from object: __class__


Method Details [hide private]

__init__(self, nr=1000)
(Constructor)

source code 
Parameters:
  • nr - Number of elements to store
Overrides: object.__init__

insert(self, dings)

source code 
Inserts am element into the ring-buffer

last(self)

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

dump(self)

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