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)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
insert(self, dings)
Inserts am element into the ring-buffer
source code
 
last(self)
Returns: the latest element in the buffer, None if nothing was inserted into the buffer
source code
 
dump(self)
Returns: A list with all the values in the ring buffer in the correct order (starting with the oldest)
source code

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 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

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

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)