DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

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

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦8a39e7c27⟧ Ada Source

    Length: 7168 (0x1c00)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Recency, seg_04a318, seg_04a9f1, seg_04b45f

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦this⟧ 

E3 Source Code



package body Recency is

    Current_Size   : Size_Type := 1;
    Current_Object : Object;


    function "<" (Left, Right : Object) return Boolean is
    begin  
        if Left.Size < Right.Size then
            return True;
        elsif Left.Size > Right.Size then
            return False;
        else
            for Index in reverse 1 .. Left.Size loop
                if Left.The_Value (Index) < Right.The_Value (Index) then
                    return True;
                elsif Left.The_Value (Index) > Right.The_Value (Index) then
                    return False;
                else
                    null;
                end if;
            end loop;
            return False;
        end if;
    end "<";


    function ">" (Left, Right : Object) return Boolean is
    begin  
        if Left.Size > Right.Size then
            return True;
        elsif Left.Size < Right.Size then
            return False;
        else
            for Index in reverse 1 .. Left.Size loop
                if Left.The_Value (Index) > Right.The_Value (Index) then
                    return True;
                elsif Left.The_Value (Index) < Right.The_Value (Index) then
                    return False;
                else
                    null;
                end if;
            end loop;
            return False;
        end if;
    end ">";


    procedure Initialize is
    begin  
        Current_Size   := 1;
        Current_Object := Object'(Size      => Current_Size,
                                  The_Value => (others => 1));
    end Initialize;


    procedure Get (The_Recency : out Object) is
    begin
        The_Recency := Current_Object;
    end Get;


    procedure Recursive_Increase (Index : Size_Type) is
    begin
        if Current_Object.The_Value (Index) < Max_Recency_Value then
            Current_Object.The_Value (Index) :=
               Current_Object.The_Value (Index) + 1;
        else  
            if Index = Current_Size then
                Current_Size   := Current_Size + 1;
                Current_Object := Object'(Size      => Current_Size,
                                          The_Value => (others => 1));
            else
                Current_Object.The_Value (Index) := 1;
                Recursive_Increase (Index + 1);  
            end if;
        end if;
    end Recursive_Increase;


    procedure Increase is
    begin  
        Recursive_Increase (1);
    end Increase;


    procedure Put (The_Object : Object; Where : Output_Stream.Object) is
        use Output_Stream;
    begin
        for I in 1 .. The_Object.Size - 1 loop
            Put (Recency_Number'Image (The_Object.The_Value (I)), Where);
            Put (", ", Where);
        end loop;
        Put (Recency_Number'Image (The_Object.The_Value (The_Object.Size)),
             Where);
    end Put;


begin
    Initialize;
end Recency;

E3 Meta Data

    nblk1=6
    nid=0
    hdr6=c
        [0x00] rec0=24 rec1=00 rec2=01 rec3=008
        [0x01] rec0=00 rec1=00 rec2=06 rec3=004
        [0x02] rec0=20 rec1=00 rec2=02 rec3=03c
        [0x03] rec0=00 rec1=00 rec2=05 rec3=004
        [0x04] rec0=21 rec1=00 rec2=03 rec3=00c
        [0x05] rec0=02 rec1=00 rec2=04 rec3=001
    tail 0x2174ea16c866e7c3bd2be 0x42a00088462063c03