Gambas Documentation - /comp/gb.data/circular

/comp/gb.data/circular

# Circular (gb.data)

A Circular buffer, or Circular for short, is a fixed-size buffer with one read and one write pointer. When data is read/written, the proper pointer is moved forward independently of the other one. When the end of the buffer is reached, the pointer wraps around to the beginning. Thus, old never-read values can be overwritten.

This datatype may be ideal for communications between entities where it does not really matter when old values get overwritten, but we still want a fixed-size buffer. For example, log messages are traditionally treated using this technique.

More information on circular buffers on Wikipedia

This class is
Dim hCircular As Circular
creatable
.

Properties | Methods
--- | ---

property Read IsEmpty As Boolean
IsEmpty
property Read IsFull As Boolean
IsFull
property Overwrite As Boolean
Overwrite
property Reader As Integer
Reader
property Size As Integer
Size
property Writer As Integer
Writer

Sub Clear ( )
Clear
Function Peek ( ) As Variant
Peek
Function Read ( ) As Variant
Read
Sub Reset ( )
Reset
Sub Resize ( Size As Integer )
Resize
Sub Write ( Value As Variant )
Write