|
|
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: 7168 (0x1c00)
Types: Ada Source
Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Generic_Fact, seg_02ccb7, 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=6
nid=0
hdr6=c
[0x00] rec0=1f rec1=00 rec2=01 rec3=002
[0x01] rec0=00 rec1=00 rec2=06 rec3=002
[0x02] rec0=20 rec1=00 rec2=02 rec3=006
[0x03] rec0=1d rec1=00 rec2=03 rec3=046
[0x04] rec0=1f rec1=00 rec2=04 rec3=020
[0x05] rec0=01 rec1=00 rec2=05 rec3=001
tail 0x21524ca9e84046fa72867 0x42a00088462063c03