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

⟦a08d351a9⟧ TextFile

    Length: 3086 (0xc0e)
    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

with Unchecked_Deallocation;
package body Generator_Of_Stat_Keys_And_Dyn_Values is

    procedure Dispose is new Unchecked_Deallocation (Integer, Value_Type);

    procedure Generate (Vector : in out Vector_Type) is
        Temp_Key : Key_Type;
        Temp_Val : Value_Type;
    begin
        for I in Vector'Range loop
            Vector (I).Key := Key_Type (I);
            Vector (I).Val := new Integer'(I);
        end loop;
        for I in reverse Vector'Range loop
            if I mod 3 /= 0 then
                Assign (Temp_Key, Vector (Vector'First).Key);
                Assign (Vector (Vector'First).Key, Vector (I).Key);
                Assign (Vector (I).Key, Temp_Key);
                Assign (Temp_Val, Vector (Vector'First).Val);
                Assign (Vector (Vector'First).Val, Vector (I).Val);
                Assign (Vector (I).Val, Temp_Val);
            end if;
        end loop;
    end Generate;

    procedure Generate2 (Vector : in out Vector_Type) is
        Temp_Key : Key_Type;
        Temp_Val : Value_Type;
    begin
        for I in Vector'Range loop
            Vector (I).Key := Key_Type (I + Vector'Last);
            Vector (I).Val := new Integer'(I + Vector'Last);
        end loop;
        for I in reverse Vector'Range loop
            if I mod 3 /= 0 then
                Assign (Temp_Key, Vector (Vector'First).Key);
                Assign (Vector (Vector'First).Key, Vector (I).Key);
                Assign (Vector (I).Key, Temp_Key);
                Assign (Temp_Val, Vector (Vector'First).Val);
                Assign (Vector (Vector'First).Val, Vector (I).Val);
                Assign (Vector (I).Val, Temp_Val);
            end if;
        end loop;
    end Generate2;

    procedure Generate_Ascending (Vector : in out Vector_Type) is
    begin
        for I in Vector'Range loop
            Vector (I).Key := Key_Type (I);
            Vector (I).Val := new Integer'(I);
        end loop;
    end Generate_Ascending;

    procedure Generate_Descending (Vector : in out Vector_Type) is
    begin
        for I in Vector'Range loop
            Vector (I).Key := Key_Type (Vector'Last - I + Vector'First);
            Vector (I).Val := new Integer'(Vector'Last - I + Vector'First);
        end loop;
    end Generate_Descending;

    procedure Assign (Dest : in out Key_Type; Source : in Key_Type) is
    begin
        Dest := Source;
    end Assign;

    procedure Assign (Dest : in out Value_Type; Source : in Value_Type) is
    begin
        if Dest = Source then
            return;
        else
            Dispose (Dest);
            Dest := new Integer'(Source.all);
        end if;
    end Assign;

    procedure Destroy (Val : in out Value_Type) is
    begin
        Dispose (Val);
    end Destroy;

    function Equals (Left, Right : Value_Type) return Boolean is
    begin
        return not (Left = null or Right = null) and then Left.all = Right.all;
    end Equals;

    function Less (Left, Right : Key_Type) return Boolean is
    begin
        return Left < Right;
    end Less;

end Generator_Of_Stat_Keys_And_Dyn_Values;