# Class: CyclicQueue

### LuxModule: luxinialuacore

The CyclicQueue is a utility class for storing cyclic fields. This is usefull for creating histories. The index operator ([]) can be used to index the queue. I.e. mylist[1] will always return the elment that was inserted last.

## Methods:

### Method overview:

- count
- history
- new
- overwrite
- pop
- push
- size
- start
- top

new (int size, [boolean overwrite])
  returns: (CyclicQueue)
  Creates a CyclicQueue object of given size. If overwrite is false (default), an error is thrown if the array is full.
count
  {[int]} - number of entries in list
history
  {[table]} - the table containing the entries
overwrite
  {[boolean]} - if false, an exception is thrown if the list is full
pop (CyclicQueue)
  returns: ([value])
  pops a value from the queue. If no element is in the list, nothing is returned
push (CyclicQueue,value)
  returns: ()
  pushes a value on the list.
size
  {[int]} - size of the list
start
  {[int]} - position of current element
top (CyclicQueue)
  returns: ([value])
  returns the latest inserted element