|
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: 8192 (0x2000) Types: Ada Source Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Generic_Fact, seg_02bad2, separate Generic_Fact_Base
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000 └─ ⟦5a81ac88f⟧ »Space Info Vol 1« └─⟦this⟧
separate (Generic_Fact_Base) package body Generic_Fact is Class_Identity : Constant_String.Object := Constant_String.Make (Class_Name); function Slot_Count return Natural is First : Natural := Slot_Names'Pos (Slot_Names'First); Last : Natural := Slot_Names'Pos (Slot_Names'Last); begin return Last - First + 1; end Slot_Count; function As_Fact_Slot_Name (Slot_Name : Slot_Names) return Generic_Fact_Base.Slot_Names is begin return Slot_Names'Pos (Slot_Name) - Slot_Names'Pos (Slot_Names'First) + 1; end As_Fact_Slot_Name; function As_Anonymous (What : Patterns) return Generic_Fact_Base.Patterns is Result : Generic_Fact_Base.Patterns (1 .. Slot_Count); begin for Slot_Name in What'Range loop Result (As_Fact_Slot_Name (Slot_Name)) := What (Slot_Name); end loop; return Result; end As_Anonymous; function As_Anonymous (What : Slots) return Working_Memory.Slots is Result : Working_Memory.Slots (1 .. Slot_Count); begin for Slot_Name in What'Range loop Result (As_Fact_Slot_Name (Slot_Name)) := What (Slot_Name); end loop; return Result; end As_Anonymous; function Exist (What : Patterns) return Query is begin return Query'(Kind => Find, Class => Class_Identity, Size => Slot_Count, Value => As_Anonymous (What)); end Exist; function Not_Any (What : Patterns) return Query is begin return Query'(Kind => Check_No, Class => Class_Identity, Size => Slot_Count, Value => As_Anonymous (What)); end Not_Any; function Get (The_Fact : Object; Slot : Slot_Names) return Integer is begin return Working_Memory.Get (The_Fact, Slot => As_Fact_Slot_Name (Slot)); end Get; function Get (The_Fact : Object) return Slots is Result : Slots; begin for Slot in Slot_Names loop Result (Slot) := Working_Memory.Get (The_Fact, Slot => As_Fact_Slot_Name (Slot)); end loop; return Result; end Get; procedure Add (The_Fact : Slots) is begin Working_Memory.Add (Working_Memory.Make (The_Class => Class_Identity, The_Slots => As_Anonymous (The_Fact))); end Add; procedure Delete (The_Fact : Object) is begin Working_Memory.Delete (The_Fact); end Delete; procedure Change (The_Fact : Object; Value : Slots) is begin Working_Memory.Change (The_Fact, Working_Memory.Make (The_Class => Class_Identity, The_Slots => As_Anonymous (Value))); end Change; procedure Change (The_Fact : Object; The_Slot : Slot_Names; To_Value : Integer) is begin Working_Memory.Change (The_Fact, As_Fact_Slot_Name (The_Slot), To_Value); end Change; procedure Put (The_Fact : Object; Where : Output_Stream.Object) is First : Boolean := True; use Output_Stream; begin Put (Class_Name & "'(", Where); Indent_Right (Where); New_Line (Where); for I in Slot_Names loop if not First then Put_Line (", ", Where); else First := False; end if; Put (Slot_Names'Image (I) & " =>", Where); Put (Attribute_Image (Get (The_Fact, Slot => I)), Where); end loop; Indent_Left (Where); Put_Line (")", Where); end Put; end Generic_Fact;
nblk1=7 nid=2 hdr6=a [0x00] rec0=1f rec1=00 rec2=01 rec3=002 [0x01] rec0=20 rec1=00 rec2=05 rec3=004 [0x02] rec0=1d rec1=00 rec2=07 rec3=044 [0x03] rec0=1f rec1=00 rec2=03 rec3=01e [0x04] rec0=01 rec1=00 rec2=06 rec3=000 [0x05] rec0=05 rec1=00 rec2=06 rec3=000 [0x06] rec0=04 rec1=d4 rec2=00 rec3=002 tail 0x21523da7683ef71726341 0x42a00088462063c03 Free Block Chain: 0x2: 0000 00 04 00 14 80 11 20 20 20 20 20 20 20 20 20 20 ┆ ┆ 0x4: 0000 00 00 00 36 80 13 65 20 20 3d 3e 20 56 61 6c 75 ┆ 6 e => Valu┆