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

⟦489206cfa⟧ Ada Source

    Length: 10240 (0x2800)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, procedure Orb, seg_0567f9

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



with Bal;
with Sub_Contrat;
with Sub_Registration;
with Identification;
with Message;
with Trans;  
with Text_Io;
with Orb_Tools;
with Ident_Link;

procedure Orb is

    M : Message.Tmessage;
    Orb_Id : constant Identification.Tclient_Id := 0;
    L_Contrat : Sub_Contrat.Contrat_List.List;
    L_Subs : Sub_Contrat.Sub_List.List;

    procedure Moulinette (M : in out Message.Tmessage) is
        Commander : Message.Command_Type;  
        Contract : Sub_Contrat.Tcontrat;
        N_Contrat : Sub_Contrat.Tnom_Contrat;
        Subs : Sub_Contrat.Tsubscription;
        Id_Tmp, Id_Tmp2 : Identification.Tclient_Id;
        Message_T_S : Bal.Tmess_To_Send;

    begin
        Message.Unfill_Command (M, Commander);
        case Commander is

            when Message.Registration =>
                -- renvoyer son id au client
                Text_Io.Put_Line ("ORB : receive a Registration...");

                Sub_Registration.Alloc_Ident (M, Id_Tmp);
                Orb_Tools.Copy (Source =>
                                   Identification.Tclient_Id'Image (Id_Tmp),
                                Target => M.Content);
                Message.Fill_Command (M, Message.Forward);
                Message_T_S.Mess := M;  
                Message_T_S.Id := Orb_Id;

                Identification.Search_Object (Id_Tmp, Message_T_S.Des);
                Bal.Put_Mts (Message_T_S);

            when Message.Unregistration =>
                -- retirer l'objet de la liste
                Text_Io.Put_Line ("Orb : receive an unregistration");
                Message.Unfill_Origin (M, Id_Tmp);
                Sub_Registration.Desalloc_Ident (Id_Tmp);

            when Message.Queries =>
                null;

            when Message.Request =>
                Text_Io.Put_Line ("Orb received a request...");
                Message.Unfill_Content (M, N_Contrat);
                Message.Unfill_Origin (M, Id_Tmp2);
                if Sub_Contrat.Contrat_Exists (L_Contrat, N_Contrat) then
                    Text_Io.Put_Line ("Such a contract exists.");

                    Id_Tmp := Sub_Contrat.Contrat_Provider
                                 (L_Contrat, N_Contrat);
                    Ident_Link.Enter_New_Link
                       (Traiteur => Id_Tmp, To_Who => Id_Tmp2);
                    Message.Fill_Command (M, Message.Forward);
                    Message.Fill_Origin (M, Orb_Id);
                    Message_T_S.Mess := M;
                    Message_T_S.Id := Id_Tmp;
                    Identification.Search_Object (Id_Tmp, Message_T_S.Des);
                    Bal.Put_Mts (Message_T_S);
                end if;

            when Message.Notification =>
                null;
                -- pas implemente

            when Message.Publication =>

                Sub_Contrat.Fill_Contrat (M, Contract);
                Sub_Contrat.Add_Contrat (L_Contrat, Contract);
                Text_Io.Put_Line ("Publication added : " &
                                  Orb_Tools.Image (Contract.Nom_Contrat));

            when Message.Unpublication =>

                Message.Unfill_Content (M, N_Contrat);
                Sub_Contrat.Remove_Contrat (L_Contrat, N_Contrat);

            when Message.Forward =>
                Message.Unfill_Origin (M, Id_Tmp2);
                Ident_Link.Search_Link (Traiteur => Id_Tmp2, To_Who => Id_Tmp);
                Message.Fill_Command (M, Message.Forward);
                Message.Fill_Origin (M, Orb_Id);
                Message_T_S.Mess := M;
                Message_T_S.Id := Id_Tmp;
                Identification.Search_Object (Id_Tmp, Message_T_S.Des);

                Bal.Put_Mts (Message_T_S);

                -- faire le reply a l'objet
                if Sub_Contrat.Subscription_Exists (L_Subs, Id_Tmp2) then
                    Text_Io.Put_Line ("Orb found a subscripter.");
                    Id_Tmp := Sub_Contrat.Subscripter (L_Subs, Id_Tmp2);  
                    Message_T_S.Mess := M;
                    Message_T_S.Id := Id_Tmp;
                    Identification.Search_Object (Id_Tmp, Message_T_S.Des);
                    Bal.Put_Mts (Message_T_S);
                end if;

            when Message.Subscription =>

                Text_Io.Put_Line ("Orb : receive a subscription.");
                Sub_Contrat.Fill_Sub (L_Contrat, M, Subs);
                Sub_Contrat.Add_Sub (L_Subs, Subs);

            when Message.Unsubscription =>

                Text_Io.Put_Line ("Orb : receive an unsubscription");
                Sub_Contrat.Fill_Sub (L_Contrat, M, Subs);
                Sub_Contrat.Remove_Sub (L_Subs, Subs.Who);

            when Message.Filtration =>
                null;
                -- pas implemente

            when Message.Unfiltration =>
                null;
                -- pas implemente       end case;
    end Moulinette;
begin
    Text_Io.Put_Line ("ORB is ready...");
    loop
        if not Bal.Is_Empty_Rm then
            Bal.Get_Rm (M);
            Moulinette (M);
        end if;
    end loop;
end Orb;

E3 Meta Data

    nblk1=9
    nid=8
    hdr6=c
        [0x00] rec0=23 rec1=00 rec2=01 rec3=05e
        [0x01] rec0=17 rec1=00 rec2=03 rec3=058
        [0x02] rec0=17 rec1=00 rec2=05 rec3=060
        [0x03] rec0=16 rec1=00 rec2=09 rec3=082
        [0x04] rec0=1b rec1=00 rec2=02 rec3=002
        [0x05] rec0=0c rec1=00 rec2=04 rec3=000
        [0x06] rec0=22 rec1=00 rec2=08 rec3=000
        [0x07] rec0=e8 rec1=7b rec2=96 rec3=32b
        [0x08] rec0=18 rec1=b2 rec2=00 rec3=007
    tail 0x21762a1f487c46c53e2f4 0x42a00088462060003
Free Block Chain:
  0x8: 0000  00 06 00 c0 80 1d 50 75 74 5f 4c 69 6e 65 20 28  ┆      Put_Line (┆
  0x6: 0000  00 07 03 fc 80 0a 74 5f 50 72 6f 76 69 64 65 72  ┆      t_Provider┆
  0x7: 0000  00 00 03 e8 80 02 29 3b 02 00 23 20 20 20 20 20  ┆      );  #     ┆