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 - metrics - download
Index: B T

⟦b1f279d63⟧ TextFile

    Length: 2280 (0x8e8)
    Types: TextFile
    Names: »B«

Derivation

└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
    └─⟦5cb1d1d7f⟧ »DATA« 
        └─⟦3b1ee7bd8⟧ 
            └─⟦this⟧ 

TextFile

package body Encapsulate is

    Shared : Composite;

    function Set_To (I : Integer) return Composite is
        Temp : Composite;
    begin
        for N in Index loop
            Temp (N) := I;
        end loop;
        return Temp;
    end Set_To;

    function Value_Of (C : Composite) return Integer is
    begin
        return C (Index'First);
    end Value_Of;

    -- FOR TESTING ONLY; THIS ALLOWS THE SCHEDULER TO OVERLAP READERS
    -- AND WRITERS AND THUS SCREW UP IF READERS_WRITERS DOESN'T DO
    -- ITS JOB. IT ALSO CHECKS THAT THE COPY IS CONSISTENT.
    procedure Copy (From : in Composite; To : in out Composite) is
    begin
        for I in Index loop
            To (I) := From (I);
            -- DELAY SO THAT ANOTHER ACCESS COULD BE MADE:
            delay 0.5;
        end loop;
        -- TEST FOR CONSISTENCY:
        for I in Index range Index'Succ (Index'First) .. Index'Last loop
            if To (I) /= To (Index'First) then
                raise Program_Error;
            end if;
        end loop;
    end Copy;

    procedure Read_Put (Item : Composite) is
    begin
        Msg.Put (Integer'Image (Value_Of (Item)) & " READ");
    end Read_Put;

    procedure Write_Put (Item : Composite) is
    begin
        Msg.Put (Integer'Image (Value_Of (Item)) & " WRITTEN");
    end Write_Put;

    task body Msg is
    begin
        loop
            select
                accept Put (S : String);
                --               TEXT_IO.PUT (S);
                --               TEXT_IO.NEW_LINE;
                --            END PUT;
            or
                terminate;
            end select;
        end loop;
    end Msg;

    package Share is new Shared_Variable (Object_Type => Composite,
                                          Object => Shared,
                                          Read_Put => Read_Put,
                                          Write_Put => Write_Put,
                                          Copy => Copy);
    use Share;

    procedure Read (C : out Composite) is
        Temp : Composite;
    begin
        Share.Read (Temp);
        C := Temp;
    end Read;

    procedure Write (C : in Composite) is
    begin
        Share.Write (C);
    end Write;

begin

    Shared := Set_To (0);

end Encapsulate;