|
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: 6144 (0x1800) Types: Ada Source Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Ensemble, seg_00f4db
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000 └─ ⟦5a81ac88f⟧ »Space Info Vol 1« └─⟦this⟧
package body Ensemble is -- TYPES ---------------------------- type Elt is record Occupe : Boolean := False; Objet : Item; end record; subtype Indice_Table is Natural range 0 .. 1000; type Table_Element is array (Indice_Table range <>) of Elt; type Ensemble_Elts (Taille : Indice_Table := 20) is record Elements : Table_Element (0 .. Taille); end record; -- VARIABLES ------------------------ Un_Ensemble : Ensemble_Elts; -- PROCEDURES ----------------------- function Ensemble_Plein return Boolean is Resultat : Boolean := True; begin for I in Un_Ensemble.Elements'Range loop Resultat := Resultat and Un_Ensemble.Elements (I).Occupe; end loop; return Resultat; end Ensemble_Plein; ------------------------------------- function Premier_Libre return Indice_Table is I : Indice_Table := Un_Ensemble.Elements'First; Trouve : Boolean := False; begin while not Trouve loop Trouve := not Un_Ensemble.Elements (I).Occupe; if not Trouve then I := I + 1; end if; end loop; return I; end Premier_Libre; ------------------------------------------------------- -- INTERFACE ------------------------------------------------------- procedure Ajouter (Element : Item; Numero : out Natural) is Ajout : Table_Element (0 .. Un_Ensemble.Taille); Position : Indice_Table; begin if Ensemble_Plein then Un_Ensemble.Elements := Un_Ensemble.Elements & Ajout; end if; Position := Premier_Libre; Un_Ensemble.Elements (Position).Objet := Element; Numero := Position; end Ajouter; ------------------------------------------------------- procedure Retirer (Numero : Natural) is begin Un_Ensemble.Elements (Numero).Occupe := False; end Retirer; ------------------------------------------------------- procedure Lire (Numero : Natural; Element : out Item) is begin Element := Un_Ensemble.Elements (Numero).Objet; end Lire; ------------------------------------------------------- procedure Ecrire (Numero : Natural; Element : Item) is begin Un_Ensemble.Elements (Numero).Objet := Element; end Ecrire; ------------------------------------------------------- procedure Verifier is begin for I in Un_Ensemble.Elements'Range loop if Un_Ensemble.Elements (I).Occupe then Modifier (Un_Ensemble.Elements (I).Objet); end if; end loop; end Verifier; ------------------------------------------------------- procedure Vider is begin for I in Un_Ensemble.Elements'Range loop Un_Ensemble.Elements (I).Occupe := False; end loop; end Vider; end Ensemble;
nblk1=5 nid=0 hdr6=a [0x00] rec0=28 rec1=00 rec2=01 rec3=058 [0x01] rec0=24 rec1=00 rec2=05 rec3=044 [0x02] rec0=02 rec1=00 rec2=02 rec3=02a [0x03] rec0=23 rec1=00 rec2=04 rec3=034 [0x04] rec0=07 rec1=00 rec2=03 rec3=001 tail 0x2150b5646822b4fec2c8d 0x42a00088462062803