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

⟦4fc865d98⟧ Ada Source

    Length: 3072 (0xc00)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, generic, package Set_Generic, pragma Module_Name 4 3978, pragma Subsystem Tools, seg_028511

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



generic
    type Element is private;
    -- must be a pure value
    -- ie. no initialization or finalization is necessary
    -- = and := are equality and copy

    pragma Must_Be_Constrained (Yes => Element);

package Set_Generic is
    pragma Subsystem (Tools);
    pragma Module_Name (4, 3978);

    type Set is private;

    procedure Initialize (S : out Set);

    function  Is_Empty   (S : Set) return Boolean;
    procedure Make_Empty (S : in out Set);

    procedure Copy (Target : in out Set; Source : Set);

    function Is_Member (S : Set; X : Element) return Boolean;

    procedure Add    (S : in out Set; X : Element);
    procedure Delete (S : in out Set; X : Element);
    -- X is (is not) in S then the operation add (delete) is a no op.

    type Iterator is private;

    procedure Init  (Iter : out Iterator; S : Set);
    procedure Next  (Iter : in out Iterator);
    function  Value (Iter : Iterator) return Element;
    function  Done  (Iter : Iterator) return Boolean;

    ------------------------------------------------------
    -- Implementation Notes and Non-Standard Operations --
    ------------------------------------------------------

    -- variables of type set are initially empty
    --    therefore, the call to initialize is optional
    --   initialize does make the set empty

    -- := and = operate on references
    --   := implies sharing (introduces an alias)
    --   = means is the same set, not the same value of type set

    -- garbage may be generated

    -- Concurrency Properties
    -- any number of read operations (is_empty,is_member) can procede
    -- concurrently with one write operations (add/delete/make_empty)

private

    type Node is
        record
            Value : Element;
            Link  : Set;
        end record;

    type Set is access Node;

    type Iterator is new Set;

end Set_Generic;

E3 Meta Data

    nblk1=2
    nid=0
    hdr6=4
        [0x00] rec0=22 rec1=00 rec2=01 rec3=014
        [0x01] rec0=21 rec1=00 rec2=02 rec3=000
    tail 0x217223f5083c174e1bd29 0x42a00088462065003