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

⟦246430b76⟧ TextFile

    Length: 2507 (0x9cb)
    Types: TextFile
    Names: »B«

Derivation

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

TextFile

with Oo_Ada_Exception;
with Text_Io;
with Tomato;
with Unchecked_Conversion;
with Unchecked_Deallocation;
with Vegetable;

package body Tomato is

    procedure Free is new Unchecked_Deallocation (State, State_Ptr);


    function Tomato_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;
        Veget_State_Ptr : Vegetable.State_Ptr;

    begin
        This_State_Ptr := new State;
        This_State_Ptr.Offspring := Offspring;
        This_Object := Vegetable.Create (1);
        Veget_State_Ptr := Vegetable.Part_Of (This_Object);
        Vegetable.Set_Heir (Veget_State_Ptr, 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);
                Vegetable.Delete (This_Object);

            when others =>
                raise Oo_Ada_Exception.Offspring_Error;
        end case;

    end Delete;


    procedure Set_Z (This_State : in out State; This_Z : Natural) is
    begin
        This_State.Z := This_Z;
    end Set_Z;


    function Get_Z (This_State : State) return Natural is
    begin
        return This_State.Z;

    end Get_Z;


    procedure Grow (This_Object : Root.Object; Marker : Boolean := False) is
    begin
        Text_Io.Put_Line ("Tomato is growing");
    end Grow;


    function Part_Of (This_Object : Root.Object) return State_Ptr is  
        This_State_Ptr : State_Ptr;
    begin
        This_State_Ptr := Tomato_View_Of
                             (S => Vegetable.Get_Heir
                                      (Vegetable.Part_Of (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 Tomato;