Startseite › Datentypen › H-Lib-Container Hilfe zum PBXB64-Compiler

H-Lib Ring (Circular Buffer)

A fixed-capacity FIFO circular buffer storing LONG values. Push writes at the tail; Pop/Peek read at the head.

Kategorie: H-Lib-Container | Zertifizierung: [ZERTIFIZIERT GETESTET]

Beschreibung

A fixed-capacity FIFO circular buffer storing LONG values. Push writes at the tail; Pop/Peek read at the head.

Kind: Container | Category: H-Lib Native Containers

PBXB64 Status: AVAILABLE

PBXB64 Certification: [CERTIFIED TESTED]

Description

This H-Lib container is implemented in native C support code and exposed through PBXB64 BASIC container syntax. The examples below are focused usage patterns; keep handles valid, release each container with its Final method, and check counts or return values when a method can fail.

Methods

MethodSignatureReturnsDescription
Newr.New capacityLNRINGAllocate a ring with the given capacity.
Finalr.FinalnoneFree the ring.
Validater.ValidateLONGNon-zero if the handle is valid.
Clearr.ClearnoneEmpty the ring.
Countr.CountLONGNumber of values currently stored.
Capacityr.CapacityLONGMaximum number of values allowed.
Trimr.TrimnoneNormalisiert den internen Speicher bei unveränderter fester Kapazität.
Cloner.CloneLNRINGGibt eine unabhängige Kopie mit derselben FIFO-Reihenfolge zurück.
Pushr.Push valuenoneFügt am Ende ein; bei vollem Puffer wird der älteste Wert überschrieben.
Popr.PopQUADRemove and return the oldest value.
Peekr.PeekQUADReturn the oldest value without removing it.
Fullr.FullLONGNon-zero if the ring is full.
Emptyr.EmptyLONGNon-zero if the ring is empty.

Validation Evidence

Validation evidence: H-Lib container behavior is exercised by registered BASIC container validation programs and the embedded H-Lib object set used by the single-EXE validation gate.

PBXB64-Prüfung

Diese Referenzseite soll durch ein fokussiertes Compile- oder Laufzeitbeispiel belegt sein. Das Beispiel soll Eingaben, erwartete Ausgabe oder Exit-Code und erforderliche Windows-Ressourcen oder Include-Dateien nennen.

Übersichtshinweise

Allgemeine Übersichtsseiten sollten trotzdem sagen, welche Familie gemeint ist, welche konkreten Befehlsseiten die Implementierung tragen und welche Formen nur der Navigation dienen. So bleibt die Seite detailliert genug, ohne so zu tun, als wäre sie eine vollständige Befehlsreferenz.

Beispiel

LOCAL r AS LNRING
r = r.New 2
r.Push 10
r.Push 20
r.Push 30   ' overwrites 10
PRINT r.Full ' non-zero
PRINT r.Pop  ' 20
r.Final