|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - download
Length: 3072 (0xc00) Types: Ada Source Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Buffer, seg_051233
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000 └─ ⟦5a81ac88f⟧ »Space Info Vol 1« └─⟦this⟧
package body Buffer is procedure Create (O : in out Object) is begin O.Nb_Item := 0; O.Tete := 1; O.Queue := 1; end Create; procedure Add (O : in out Object; I : Item) is begin if Is_Full (O) then raise Buffer_Full_Error; else O.Buff (O.Queue) := I; O.Nb_Item := O.Nb_Item + 1; O.Queue := (O.Queue mod Taille) + 1; end if; end Add; procedure Get (O : in out Object; I : in out Item) is begin if Is_Empty (O) then raise Buffer_Empty_Error; else I := O.Buff (O.Tete); O.Tete := (O.Tete mod Taille) + 1; O.Nb_Item := O.Nb_Item - 1; end if; end Get; function Is_Empty (O : Object) return Boolean is begin return (O.Nb_Item = 0); end Is_Empty; function Is_Full (O : Object) return Boolean is begin return (O.Nb_Item = Taille); end Is_Full; function Empty_Places (O : Object) return Natural is begin return (Taille - O.Nb_Item); end Empty_Places; end Buffer;
nblk1=2 nid=0 hdr6=4 [0x00] rec0=2b rec1=00 rec2=01 rec3=008 [0x01] rec0=0a rec1=00 rec2=02 rec3=001 tail 0x2154b286887995af794af 0x42a00088462060003