comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@acm.org
Subject: Re: Dynamic dispatch again
Date: Mon, 08 Oct 2001 04:23:38 GMT
Date: 2001-10-08T04:23:38+00:00	[thread overview]
Message-ID: <eT9w7.14545$IY3.9995279@news1.rdc1.sfba.home.com> (raw)
In-Reply-To: 3BC0FDB3.F185EDDF@san.rr.com

>Here, I only get to have one piece of code per
>profile execute per message. I.e., now I only get one accept per unit. I
>can't do something like
>...
>I instead have to store the state and wait passively for a call to be made.
  Huh?  What's wrong with replacing the single changeable xlate with a
bunch of changeable accept's and other calls, eg:

package profile is

  type changeable_content is abstract tagged limited null record;
  type changeable_content_pointer is access all changeable_content'class;

--   procedure xlate_content(what_to_do : in changeable_content;
--                           in_in : in integer; out_out : out integer)
--       is abstract;
    procedure initialize_content(what_to_do : in changeable_content;
                                 params : in ...; ready : out boolean)
      is abstract;
    procedure connection_content(what_to_do : in changeable_content;
                                 params : ...)
      is abstract;
    procedure send_message_content(what_to_do : in changeable_content;
                                   ...)
      is abstract;
    procedure recv_message_content(what_to_do : in changeable_content;
                                   ...)
      is abstract;
    procedure stick_in_database_content(what_to_do : in changeable_content;
                                        ...)
      is abstract;

  task type general_task(content : changeable_content_pointer) is
--     entry xlate(in_in : in integer; out_out : out integer);
    entry initialize(params : in ...; ready : out boolean);
    entry connection(params : ...);
    entry recv_message(...);
  end general_task;
  type general_task_pointer is access general_task;

end profile;

package body profile is

    task body general_task is
    begin
--         loop
--             select
--                 accept xlate(in_in : in integer; out_out : out integer)
-- do
--                     xlate_content(content.all, in_in, out_out);
--                 end xlate;
--             or
--                 terminate;
--             end select;
--         end loop;
      accept initialize(params : in ...; ready : out boolean) do
        initialize_content(content.all, params, ready);
      end accept;
      accept connection(params : ...) do
        -- set up connection
        connection_content(content.all, params);
      end accept;
      send_message(...); -- peer receiving open is first to send message
      send_message_content(content.all, ...);
      accept recv_message(...) do
        -- Process first answer
        recv_message_content(content.all, ...);
      end accept;
      stick_in_database(...);
      stick_in_database_content(content.all, ...);
      accept recv_message(...) do
        -- Process second answer
        recv_message_content(content.all, ...);
      end accept;
      ...
    end general_task;

end profile;



  reply	other threads:[~2001-10-08  4:23 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-06  1:08 Dynamic dispatch again Darren New
2001-10-06 17:52 ` tmoran
2001-10-08  1:13   ` Darren New
2001-10-08  4:23     ` tmoran [this message]
2001-10-08 16:26       ` Darren New
2001-10-08 18:21         ` tmoran
2001-10-08 19:07           ` Darren New
2001-10-09  0:25             ` tmoran
2001-10-09  0:40               ` Darren New
2001-10-09  1:29                 ` Larry Hazel
2001-10-09  4:10                 ` tmoran
2001-10-09 15:40                   ` Darren New
2001-10-09 17:58                     ` tmoran
2001-10-09 19:26                       ` Darren New
2001-10-09 19:42                         ` tmoran
2001-10-09 20:23                           ` Darren New
2001-10-09 22:37                         ` tmoran
2001-10-10 18:17                           ` Darren New
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox