|
|
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 - metrics - download
Length: 8192 (0x2000)
Types: Ada Source
Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Generic_Fact, seg_02acf1
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦cfc2e13cd⟧ »Space Info Vol 2«
└─⟦this⟧
with Constant_String;
with Text_Io;
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 Fact.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 Fact.Patterns is
Result : Fact.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 Fact.Slots is
Result : Fact.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 Fact.Query is
begin
return Fact.Query'(Kind => Fact.Find,
Class => Class_Identity,
Size => Slot_Count,
Value => As_Anonymous (What));
end Exist;
function Not_Any (What : Patterns) return Fact.Query is
begin
return Fact.Query'(Kind => Fact.Check_No,
Class => Class_Identity,
Size => Slot_Count,
Value => As_Anonymous (What));
end Not_Any;
function Get (The_Fact : Fact.Name; Slot : Slot_Names) return Integer is
begin
return Fact.Get (The_Fact, Slot => As_Fact_Slot_Name (Slot));
end Get;
function Get (The_Fact : Fact.Name) return Slots is
Result : Slots;
begin
for Slot in Slot_Names loop
Result (Slot) := Fact.Get (The_Fact,
Slot => As_Fact_Slot_Name (Slot));
end loop;
return Result;
end Get;
procedure Add (The_Fact : Slots) is
begin
Fact.Add ((Size => The_Fact'Length,
Class => Class_Identity,
Value => As_Anonymous (The_Fact)));
end Add;
procedure Delete (The_Fact : Fact.Name) is
begin
Fact.Delete (The_Fact);
end Delete;
procedure Change (The_Fact : Fact.Name; Value : Slots) is
begin
Fact.Change (The_Fact,
Value => (Size => Value'Length,
Class => Class_Identity,
Value => As_Anonymous (Value)));
end Change;
procedure Change (The_Fact : Fact.Name;
The_Slot : Slot_Names;
To_Value : Integer) is
begin
Fact.Change (The_Fact, As_Fact_Slot_Name (The_Slot), To_Value);
end Change;
procedure Put (The_Fact : Fact.Name; 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=23 rec1=00 rec2=01 rec3=020
[0x01] rec0=00 rec1=00 rec2=04 rec3=058
[0x02] rec0=1d rec1=00 rec2=05 rec3=060
[0x03] rec0=21 rec1=00 rec2=07 rec3=006
[0x04] rec0=1c rec1=00 rec2=06 rec3=000
[0x05] rec0=04 rec1=00 rec2=02 rec3=000
[0x06] rec0=14 rec1=00 rec2=03 rec3=000
tail 0x21723eaa083e56f6295f9 0x42a00088462063c03
Free Block Chain:
0x2: 0000 00 03 00 03 00 00 00 20 50 75 74 5f 4c 69 6e 65 ┆ Put_Line┆
0x3: 0000 00 00 02 89 00 1a 20 20 20 20 20 20 20 20 75 73 ┆ us┆