Module RingBuffer

环形缓冲区(Ring Buffer)

Functions

new (size) 创建
empty () 是否为空
full () 是否已满
length () 当前长度
push (value) 入队(push)
pop () 出队(pop)
peek () 查看队首
clear () 清空
items () 遍历(调试用)
toTable () 转 table(调试用)
info () 调试信息


Functions

new (size)
创建

Parameters:

  • size number 固定容量
empty ()
是否为空
full ()
是否已满
length ()
当前长度
push (value)
入队(push) 返回: true 成功 false 满了

Parameters:

  • value 满了:默认丢弃最旧数据(工业常用策略)
pop ()
出队(pop)
peek ()
查看队首
clear ()
清空
items ()
遍历(调试用)
toTable ()
转 table(调试用)
info ()
调试信息
generated by LDoc 1.5.0 Last updated 2026-08-01 10:41:17