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

⟦c02fe5a8f⟧ TextFile

    Length: 9372 (0x249c)
    Types: TextFile
    Names: »B«

Derivation

└─⟦149519bd4⟧ Bits:30000546 8mm tape, Rational 1000, !projects 93-07-13
    └─ ⟦124ff5788⟧ »DATA« 
        └─⟦this⟧ 
└─⟦f64eaa120⟧ Bits:30000752 8mm tape, Rational 1000, !projects 93 02 16
    └─ ⟦6f12a12be⟧ »DATA« 
        └─⟦this⟧ 

TextFile

with Instance;

package body Tuple is


    procedure Null_Action (The_Tuple : Tuple.Object) is
    begin
        null;
    end Null_Action;


    function Cardinality (Of_Tuple : Tuple.Object) return Natural is
    begin
        return Of_Tuple.Count;
    end Cardinality;


    function Is_Null (The_Tuple : Tuple.Object) return Boolean is
    begin
        return The_Tuple.Count = 0;
    end Is_Null;


    procedure For_All (The_Tuple : Tuple.Object) is
    begin
        for I in 1 .. The_Tuple.Count loop
            Action (The_Tuple.Cells (I));
        end loop;
    end For_All;


    procedure Split (The_Tuple :     Tuple.Object;
                     In_Ref1   : out Instance.Reference) is
    begin
        In_Ref1 := The_Tuple.Cells (1);
    end Split;


    procedure Split (The_Tuple        :     Tuple.Object;
                     In_Ref1, In_Ref2 : out Instance.Reference) is
    begin
        In_Ref1 := The_Tuple.Cells (1);
        In_Ref2 := The_Tuple.Cells (2);
    end Split;

    procedure Split (The_Tuple                 :     Tuple.Object;
                     In_Ref1, In_Ref2, In_Ref3 : out Instance.Reference) is
    begin
        In_Ref1 := The_Tuple.Cells (1);
        In_Ref2 := The_Tuple.Cells (2);
        In_Ref3 := The_Tuple.Cells (3);
    end Split;

    procedure Split (The_Tuple                          : Tuple.Object;
                     In_Ref1, In_Ref2, In_Ref3, In_Ref4 : out
                        Instance.Reference) is
    begin
        In_Ref1 := The_Tuple.Cells (1);
        In_Ref2 := The_Tuple.Cells (2);
        In_Ref3 := The_Tuple.Cells (3);
        In_Ref4 := The_Tuple.Cells (4);
    end Split;

    procedure Split (The_Tuple : Tuple.Object;
                     In_Ref1, In_Ref2, In_Ref3, In_Ref4, In_Ref5 : out
                        Instance.Reference) is
    begin
        In_Ref1 := The_Tuple.Cells (1);
        In_Ref2 := The_Tuple.Cells (2);
        In_Ref3 := The_Tuple.Cells (3);
        In_Ref4 := The_Tuple.Cells (4);
        In_Ref5 := The_Tuple.Cells (5);
    end Split;

    procedure Split (The_Tuple : Tuple.Object;
                     In_Ref1, In_Ref2, In_Ref3, In_Ref4, In_Ref5, In_Ref6 : out
                        Instance.Reference) is
    begin
        In_Ref1 := The_Tuple.Cells (1);
        In_Ref2 := The_Tuple.Cells (2);
        In_Ref3 := The_Tuple.Cells (3);
        In_Ref4 := The_Tuple.Cells (4);
        In_Ref5 := The_Tuple.Cells (5);
        In_Ref6 := The_Tuple.Cells (6);
    end Split;

    procedure Split (The_Tuple                 :     Tuple.Object;
                     In_Ref1, In_Ref2, In_Ref3, In_Ref4,
                     In_Ref5, In_Ref6, In_Ref7 : out Instance.Reference) is
    begin
        In_Ref1 := The_Tuple.Cells (1);
        In_Ref2 := The_Tuple.Cells (2);
        In_Ref3 := The_Tuple.Cells (3);
        In_Ref4 := The_Tuple.Cells (4);
        In_Ref5 := The_Tuple.Cells (5);
        In_Ref6 := The_Tuple.Cells (6);
        In_Ref7 := The_Tuple.Cells (7);
    end Split;

    procedure Split (The_Tuple                          : Tuple.Object;
                     In_Ref1, In_Ref2, In_Ref3, In_Ref4,
                     In_Ref5, In_Ref6, In_Ref7, In_Ref8 : out
                        Instance.Reference) is
    begin
        In_Ref1 := The_Tuple.Cells (1);
        In_Ref2 := The_Tuple.Cells (2);
        In_Ref3 := The_Tuple.Cells (3);
        In_Ref4 := The_Tuple.Cells (4);
        In_Ref5 := The_Tuple.Cells (5);
        In_Ref6 := The_Tuple.Cells (6);
        In_Ref7 := The_Tuple.Cells (7);
        In_Ref8 := The_Tuple.Cells (8);
    end Split;

    procedure Split (The_Tuple                          : Tuple.Object;
                     In_Ref1, In_Ref2, In_Ref3, In_Ref4, In_Ref5,
                     In_Ref6, In_Ref7, In_Ref8, In_Ref9 : out
                        Instance.Reference) is
    begin
        In_Ref1 := The_Tuple.Cells (1);
        In_Ref2 := The_Tuple.Cells (2);
        In_Ref3 := The_Tuple.Cells (3);
        In_Ref4 := The_Tuple.Cells (4);
        In_Ref5 := The_Tuple.Cells (5);
        In_Ref6 := The_Tuple.Cells (6);
        In_Ref7 := The_Tuple.Cells (7);
        In_Ref8 := The_Tuple.Cells (8);
        In_Ref9 := The_Tuple.Cells (9);
    end Split;

    procedure Split (The_Tuple : Tuple.Object;
                     In_Ref1, In_Ref2, In_Ref3, In_Ref4, In_Ref5,
                     In_Ref6, In_Ref7, In_Ref8, In_Ref9, In_Ref10 : out
                        Instance.Reference) is
    begin
        In_Ref1  := The_Tuple.Cells (1);
        In_Ref2  := The_Tuple.Cells (2);
        In_Ref3  := The_Tuple.Cells (3);
        In_Ref4  := The_Tuple.Cells (4);
        In_Ref5  := The_Tuple.Cells (5);
        In_Ref6  := The_Tuple.Cells (6);
        In_Ref7  := The_Tuple.Cells (7);
        In_Ref8  := The_Tuple.Cells (8);
        In_Ref9  := The_Tuple.Cells (9);
        In_Ref10 := The_Tuple.Cells (10);
    end Split;



    function Get (In_Tuple : Tuple.Object; The_Item : Positive := 1)
                 return Instance.Reference is
        A_Reference : Instance.Reference := Instance.Null_Reference;
    begin
        if The_Item <= In_Tuple.Count then
            A_Reference := In_Tuple.Cells (The_Item);
        end if;  
        return A_Reference;
    end Get;


    procedure Add (In_Tuple      : in out Tuple.Object;
                   The_Reference :        Instance.Reference) is
    begin
        In_Tuple.Count := In_Tuple.Count + 1;
        if In_Tuple.Count > In_Tuple.Unity then
            raise Overflow;
        else
            In_Tuple.Cells (In_Tuple.Count) := The_Reference;
        end if;
    exception
        when Constraint_Error =>
            raise Overflow;
    end Add;


    procedure Merge (In_Tuple   : in out Tuple.Object;
                     With_Size  : Natural;
                     The_Ref_1  : Instance.Reference := Instance.Null_Reference;
                     The_Ref_2  : Instance.Reference := Instance.Null_Reference;
                     The_Ref_3  : Instance.Reference := Instance.Null_Reference;
                     The_Ref_4  : Instance.Reference := Instance.Null_Reference;
                     The_Ref_5  : Instance.Reference := Instance.Null_Reference;
                     The_Ref_6  : Instance.Reference := Instance.Null_Reference;
                     The_Ref_7  : Instance.Reference := Instance.Null_Reference;
                     The_Ref_8  : Instance.Reference := Instance.Null_Reference;
                     The_Ref_9  : Instance.Reference := Instance.Null_Reference;
                     The_Ref_10 : Instance.Reference :=
                        Instance.Null_Reference) is
    begin  
        declare
            use Instance;
        begin  
            if With_Size >= 1 and With_Size <= 10 then
                In_Tuple.Unity := With_Size;
            else
                In_Tuple.Unity := 1;
            end if;
            if The_Ref_1 /= Instance.Null_Reference then
                Add (In_Tuple => In_Tuple, The_Reference => The_Ref_1);
            end if;
            if The_Ref_2 /= Instance.Null_Reference then
                Add (In_Tuple => In_Tuple, The_Reference => The_Ref_2);
            end if;
            if The_Ref_3 /= Instance.Null_Reference then
                Add (In_Tuple => In_Tuple, The_Reference => The_Ref_3);
            end if;
            if The_Ref_4 /= Instance.Null_Reference then
                Add (In_Tuple => In_Tuple, The_Reference => The_Ref_4);
            end if;
            if The_Ref_5 /= Instance.Null_Reference then
                Add (In_Tuple => In_Tuple, The_Reference => The_Ref_5);
            end if;
            if The_Ref_6 /= Instance.Null_Reference then
                Add (In_Tuple => In_Tuple, The_Reference => The_Ref_6);
            end if;
            if The_Ref_7 /= Instance.Null_Reference then
                Add (In_Tuple => In_Tuple, The_Reference => The_Ref_7);
            end if;
            if The_Ref_8 /= Instance.Null_Reference then
                Add (In_Tuple => In_Tuple, The_Reference => The_Ref_8);
            end if;
            if The_Ref_9 /= Instance.Null_Reference then
                Add (In_Tuple => In_Tuple, The_Reference => The_Ref_9);
            end if;
            if The_Ref_10 /= Instance.Null_Reference then
                Add (In_Tuple => In_Tuple, The_Reference => The_Ref_10);
            end if;
        end;
    end Merge;


    function Object_To_Tuple
                (The_Reference : Instance.Reference) return Tuple.Object is
        Result_Tuple : Tuple.Object;
    begin
        Add (In_Tuple => Result_Tuple, The_Reference => The_Reference);
        return Result_Tuple;
    end Object_To_Tuple;



    procedure Sort (The_Tuple : in out Tuple.Object) is
        Index : Integer range The_Tuple.Cells'First - 1 .. The_Tuple.Cells'Last;
        A_Reference : Instance.Reference;
    begin
        for I in The_Tuple.Cells'First + 1 .. The_Tuple.Count - 1 loop
            A_Reference := The_Tuple.Cells (I);
            Index       := I - 1;
            while (Index /= The_Tuple.Cells'First - 1) and then
                     (A_Reference < The_Tuple.Cells (Index)) loop
                The_Tuple.Cells (Index + 1) := The_Tuple.Cells (Index);
                Index                       := Index - 1;
            end loop;
            The_Tuple.Cells (Index + 1) := A_Reference;
        end loop;
    end Sort;

end Tuple;