|
|
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: 6144 (0x1800)
Types: Ada Source
Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Plant, package body Self, seg_03a5fc
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦cfc2e13cd⟧ »Space Info Vol 2«
└─⟦this⟧
with Oo_Ada_Exception;
with Text_Io;
with Unchecked_Conversion;
with Unchecked_Deallocation;
with Vegetable;
package body Plant is
procedure Free is new Unchecked_Deallocation (State, State_Ptr);
function Plant_View_Of is
new Unchecked_Conversion (Source => Root.Object, Target => State_Ptr);
function Root_View_Of is
new Unchecked_Conversion (Source => State_Ptr, Target => Root.Object);
function Create (Offspring : Natural) return Root.Object is
This_Object : Root.Object;
This_State_Ptr : State_Ptr;
begin
This_State_Ptr := new State;
This_State_Ptr.Offspring := Offspring;
This_Object := Root.Create (1);
Root.Set_Heir (This_Object, Root_View_Of (This_State_Ptr));
return This_Object;
end Create;
procedure Delete (This_Object : in out Root.Object) is
This_State_Ptr : State_Ptr := Part_Of (This_Object);
begin
case This_State_Ptr.Offspring is
when 0 =>
Free (This_State_Ptr);
Root.Delete (This_Object);
when 1 =>
Vegetable.Delete (This_Object);
when others =>
raise Oo_Ada_Exception.Offspring_Error;
end case;
end Delete;
procedure Set_X (This_State_Ptr : State_Ptr; This_X : Natural) is
begin
This_State_Ptr.X := This_X;
end Set_X;
function Get_X (This_State_Ptr : State_Ptr) return Natural is
begin
return This_State_Ptr.X;
end Get_X;
package Self is
procedure Grow (This_Object : Root.Object; Marker : Boolean := False);
end Self;
package body Self is
procedure Grow (This_Object : Root.Object; Marker : Boolean := False) is
begin
Text_Io.Put_Line ("The plant is growing ...");
end Grow;
end Self;
procedure Grow (This_Object : Root.Object; Marker : Boolean := False) is
This_State_Ptr : State_Ptr := Part_Of (This_Object);
begin
case This_State_Ptr.Offspring is
when 0 =>
Self.Grow (This_Object);
when 1 =>
if not Marker then
Vegetable.Grow (This_Object);
else
Self.Grow (This_Object);
end if;
when others =>
raise Oo_Ada_Exception.Offspring_Error;
end case;
end Grow;
function Part_Of (This_Object : Root.Object) return State_Ptr is
This_State_Ptr : State_Ptr;
begin
This_State_Ptr := Plant_View_Of (S => Root.Get_Heir (This_Object));
if This_State_Ptr = null then
raise Oo_Ada_Exception.Part_Of_Error;
end if;
return This_State_Ptr;
end Part_Of;
procedure Set_Heir (This_State_Ptr : in out State_Ptr;
Heir : Root.Object) is
begin
This_State_Ptr.Heir := Heir;
end Set_Heir;
function Get_Heir (This_State_Ptr : State_Ptr) return Root.Object is
begin
return This_State_Ptr.Heir;
end Get_Heir;
end Plant;
nblk1=5
nid=4
hdr6=8
[0x00] rec0=26 rec1=00 rec2=01 rec3=008
[0x01] rec0=27 rec1=00 rec2=03 rec3=028
[0x02] rec0=20 rec1=00 rec2=02 rec3=072
[0x03] rec0=0d rec1=00 rec2=05 rec3=000
[0x04] rec0=04 rec1=00 rec2=04 rec3=000
tail 0x21737db0c8507798eca71 0x42a00088462060003
Free Block Chain:
0x4: 0000 00 00 00 3c 80 12 69 73 5f 53 74 61 74 65 5f 50 ┆ < is_State_P┆