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

⟦09d5dc1a9⟧ TextFile

    Length: 4461 (0x116d)
    Types: TextFile
    Names: »B«

Derivation

└─⟦149519bd4⟧ Bits:30000546 8mm tape, Rational 1000, !projects 93-07-13
    └─ ⟦124ff5788⟧ »DATA« 
        └─⟦this⟧ 
└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
    └─ ⟦129cab021⟧ »DATA« 
        └─⟦this⟧ 
└─⟦f64eaa120⟧ Bits:30000752 8mm tape, Rational 1000, !projects 93 02 16
    └─ ⟦6f12a12be⟧ »DATA« 
        └─⟦this⟧ 
└─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04
    └─ ⟦d65440be7⟧ »DATA« 
        └─⟦this⟧ 

TextFile

with Expertsystem;
use Expertsystem;

package body Sticker is

    type Sticker_Structure is
        record
            Color : Colors;
            State : States;
        end record;


    package Behavior is new Classbehavior (Sticker_Structure, "STICKERS  ");

------------------------------------------------------------------------------
    function Color (O : Object) return Colors is
    begin
        return Behavior.Get (O).Color;
    end Color;

    function State (O : Object) return States is
    begin
        return Behavior.Get (O).State;
    end State;

------------------------------------------------------------------------------
    function Instances (Kind : Existences := All_Stickers)
                       return Collection.Object is
        Co : Collection.Object;
        function White_Sticker_Predicate (O : Object) return Boolean is
        begin
            return Behavior.Get (O).Color = White;
        end White_Sticker_Predicate;
        function White_Stickers is
           new Collection.Restrict (White_Sticker_Predicate);

        function Red_Sticker_Predicate (O : Object) return Boolean is
        begin
            return Behavior.Get (O).Color = Red;
        end Red_Sticker_Predicate;
        function Red_Stickers is
           new Collection.Restrict (Red_Sticker_Predicate);

        function Unused_Predicate (O : Object) return Boolean is
        begin
            return Behavior.Get (O).State = Is_Unused;
        end Unused_Predicate;
        function Unused is new Collection.Restrict (Unused_Predicate);
    begin
        case Kind is
            when All_Stickers =>
                return Behavior.Instances;
            when Unused_Stickers =>
                return Unused (Behavior.Instances);
            when White_Stickers =>
                return White_Stickers (Behavior.Instances);
            when Red_Stickers =>
                return Red_Stickers (Behavior.Instances);
            when others =>
                return Behavior.Instances;
        end case;
        return Co;
    end Instances;

------------------------------------------------------------------------------
    function Exist (With_Color : String; In_Kind_Of_Collection : Existences)
                   return Boolean is
        function Is_Color (O : Object) return Boolean is
        begin
            return Colors'Image (Behavior.Get (O).Color) = With_Color;
        end Is_Color;  
        function Exist_Color is new Collection.Exist (Is_Color);
    begin
        return Exist_Color (Instances (Kind => In_Kind_Of_Collection));
    end Exist;

    function Exist (With_State : States; In_Kind_Of_Collection : Existences)
                   return Boolean is
        function Is_State (O : Object) return Boolean is
        begin
            return Behavior.Get (O).State = With_State;
        end Is_State;  
        function Exist_State is new Collection.Exist (Is_State);
    begin
        return Exist_State (Instances (Kind => In_Kind_Of_Collection));
    end Exist;

------------------------------------------------------------------------------
    function Add (With_Color : Colors := Default_Color;
                  With_State : States := Default_State) return Object is
        A_Sticker : Sticker_Structure;
    begin
        A_Sticker.Color := With_Color;
        A_Sticker.State := With_State;
        return Behavior.Allocate (Initvalue => A_Sticker);
    end Add;

------------------------------------------------------------------------------
    procedure Change (O : Object; With_Color : Colors; With_State : States) is
        A_Sticker : Sticker_Structure;
    begin
        A_Sticker       := Behavior.Get (Aref => O);
        A_Sticker.Color := With_Color;
        A_Sticker.State := With_State;
        Behavior.Set (Aref => O, Withvalue => A_Sticker);
    end Change;

    procedure Change (O : Object; With_State : States) is
        A_Sticker : Sticker_Structure;
    begin
        A_Sticker       := Behavior.Get (Aref => O);
        A_Sticker.State := With_State;
        Behavior.Set (Aref => O, Withvalue => A_Sticker);
    end Change;


------------------------------------------------------------------------------
    procedure Delete (O : Object) is
    begin
        Behavior.Dispose (Aref => O);
    end Delete;

------------------------------------------------------------------------------
    procedure Clean is
    begin
        Behavior.Clear;
    end Clean;


end Sticker;