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

⟦d261032e8⟧ TextFile

    Length: 1756 (0x6dc)
    Types: TextFile
    Names: »B«

Derivation

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

TextFile

with Text_Io;
with Unchecked_Conversion;
package body Animal is

    type P_Animal_State is access Animal.State;

    function Animal_View_Of is
       new Unchecked_Conversion
              (Source => Application.Object, Target => Animal.State);

    function Application_View_Of is
       new Unchecked_Conversion (Source => P_Animal_State,
                                 Target => Application.Object);


    function Part_Of (Object : Animal.Object) return State is
    begin
        return Animal_View_Of
                  (S => Application.Heir (Application.Object (Object)));
    end Part_Of;


    function Create (Offspring_No : Natural := 0) return Object is
        App : Application.Object;
        P : P_Animal_State;
    begin
        P := new Animal.State;
        P.Offspring_No := Offspring_No;
        P.Heir := null;
        App := Application.Create (1);
        Application.Set_Heir (App, Application_View_Of (P));
        return Animal.Object (App);
    end Create;


    procedure Sleep (Animal : Standard.Animal.Object; Time : Duration) is
    begin
        Text_Io.Put_Line ("animal sleeping ...");
        delay Time;
        Text_Io.Put_Line ("animal waking up");
    end Sleep;


    procedure Set_Mass
                 (Animal : in out Standard.Animal.Object; Kg : Positive) is
        A : Standard.Animal.State := Standard.Animal.Part_Of (Animal);
    begin
        A.Mass := Kg;
    end Set_Mass;


    function Mass (Animal : Standard.Animal.Object) return Positive is
    begin
        return Standard.Animal.Part_Of (Animal).Mass;
    end Mass;
    procedure Set_Heir (State : in out Animal.State;
                        Heir : Application.Object) is
    begin
        State.Heir := Heir;
    end Set_Heir;
end Animal;