DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ B T

⟦7f1c0f1bc⟧ TextFile

    Length: 4696 (0x1258)
    Types: TextFile
    Names: »B«

Derivation

└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
    └─ ⟦129cab021⟧ »DATA« 
        └─⟦this⟧ 

TextFile

with Leaf;
with List_Generic;
with Log_Report;
with Oo_Ada_Exception;
with Unchecked_Conversion;
with Unchecked_Deallocation;

package body Plant is

    type State is
        record
            X : Natural;
            Has_Leaves : Ref_Of_Leaves;  
            Offspring : Natural := 0;
            Heir : Root.Object;
            Origin : Root.Object;
            Multiple : Root.Object;
        end record;

    package Leaves is new List_Generic (Element => Leaf.Object);

    type List_Of_Leaves is
        record
            Leaf_Type : Leaves.List;
            Leaf_Iter : Leaves.Iterator;
        end record;


    procedure Free is new Unchecked_Deallocation (State, Object);


    function Plant_View_Of is new Unchecked_Conversion
                                     (Source => Root.Object, Target => Object);


    function Root_View_Of is new Unchecked_Conversion
                                    (Source => Object, Target => Root.Object);


    function Create (Offspring : Natural := 0; Nb_Leaves : Natural := 1)
                    return Object is separate;


    procedure Delete (This_Object : in out Object;
                      Marker : Boolean := False) is separate;


    procedure Set_X (This_Object : Object; This_X : Natural) is
    begin
        This_Object.X := This_X;
    end Set_X;


    function Get_X (This_Object : Object) return Natural is
    begin
        return This_Object.X;
    end Get_X;


    procedure Set_Leaves (This_Object : Object; With_Leaves : Ref_Of_Leaves) is
    begin
        This_Object.Has_Leaves := With_Leaves;  
    end Set_Leaves;


    function Get_Leaves (This_Object : Object) return Ref_Of_Leaves is
    begin
        return This_Object.Has_Leaves;
    end Get_Leaves;


    package Self is
        procedure Grow (This_Object : Object; Marker : Boolean := False);
    end Self;

    package body Self is separate;


    procedure Grow (This_Object : Object;
                    Marker : Boolean := False) is separate;


    procedure Image (This_Object : Object) is separate;


    procedure Free (List : in out Ref_Of_Leaves) is  
    begin
        Leaves.Free (List.Leaf_Type);
    end Free;


    procedure Insert (Element : Leaf.Object; In_List : Ref_Of_Leaves) is
        A_List : Leaves.List;
    begin
        A_List := Leaves.Make (Element, In_List.Leaf_Type);
        In_List.Leaf_Type := A_List;
    end Insert;


    function Nil return Ref_Of_Leaves is
        A_Ref_Of_Leaves : Ref_Of_Leaves := new List_Of_Leaves;
    begin
        A_Ref_Of_Leaves.Leaf_Type := Leaves.Nil;
        return A_Ref_Of_Leaves;
    end Nil;


    function Is_Empty (List : Ref_Of_Leaves) return Boolean is  
    begin
        return Leaves.Is_Empty (List.Leaf_Type);
    end Is_Empty;


    function Arg_Number (List : Ref_Of_Leaves) return Natural is  
    begin
        return Leaves.Length (List.Leaf_Type);
    end Arg_Number;

    procedure Init (A_List : Ref_Of_Leaves) is
    begin
        Leaves.Init (A_List.Leaf_Iter, A_List.Leaf_Type);
    end Init;

    procedure Next (A_List : Ref_Of_Leaves) is  
    begin
        Leaves.Next (A_List.Leaf_Iter);
    end Next;

    function Value (A_List : Ref_Of_Leaves) return Leaf.Object is  
    begin
        return Leaves.Value (A_List.Leaf_Iter);
    end Value;

    function Done (A_List : Ref_Of_Leaves) return Boolean is  
    begin
        return Leaves.Done (A_List.Leaf_Iter);
    end Done;


    function Part_Of (This_Origin_Object : Root.Object) return Object is
        This_Object : Object;
    begin
        This_Object := Plant_View_Of (S => Root.Get_Heir (This_Origin_Object));

        return This_Object;
    end Part_Of;


    function Protected_Conv (Source : Root.Object) return Object is  
    begin
        return Plant_View_Of (Source);
    end Protected_Conv;


    procedure Set_Heir (This_Object : in out Object; Heir : Root.Object) is
    begin
        This_Object.Heir := Heir;
    end Set_Heir;


    function Get_Heir (This_Object : Object) return Root.Object is
    begin
        return This_Object.Heir;
    end Get_Heir;


    procedure Set_Origin (This_Object : in out Object; Origin : Root.Object) is
    begin
        This_Object.Origin := Origin;
    end Set_Origin;


    function Get_Origin (This_Object : Object) return Root.Object is
    begin
        return This_Object.Origin;
    end Get_Origin;


    procedure Set_Multiple (This_Object : in out Object;
                            Multiple : Root.Object) is
    begin
        This_Object.Multiple := Multiple;
    end Set_Multiple;


    function Get_Multiple (This_Object : Object) return Root.Object is
    begin
        return This_Object.Multiple;
    end Get_Multiple;

end Plant;