|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - downloadIndex: ┃ B T ┃
Length: 3003 (0xbbb) Types: TextFile Names: »B«
└─⟦149519bd4⟧ Bits:30000546 8mm tape, Rational 1000, !projects 93-07-13 └─ ⟦124ff5788⟧ »DATA« └─⟦this⟧ └─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11 └─ ⟦129cab021⟧ »DATA« └─⟦this⟧ └─⟦f64eaa120⟧ Bits:30000752 8mm tape, Rational 1000, !projects 93 02 16 └─ ⟦6f12a12be⟧ »DATA« └─⟦this⟧ └─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04 └─ ⟦d65440be7⟧ »DATA« └─⟦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;