From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4e39e3650a0d633 X-Google-Attributes: gid103376,public From: dennison@telepath.com Subject: Re: Icon Co-Expressions in Ada Date: 1998/12/16 Message-ID: <759856$54b$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 422997024 References: X-Http-Proxy: 1.0 x7.dejanews.com:80 (Squid/1.1.22) for client 204.48.27.130 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Wed Dec 16 21:19:37 1998 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.5 [en] (WinNT; I) Date: 1998-12-16T00:00:00+00:00 List-Id: In article , Ehud Lamm wrote: > user use tasks. It is sad, since as far as I know you can't simply make an > Ada procedure behave in a task like way, by invking other procedures. The > task must be explicit. If we are talking Ada 95, there actually are (at least) *two* to do this. Either way you start with a task type, and a manager or registrar package. Each routine you want to "task-ize" must register with the manager. When a procedure registers, it provides a subprogram with a standard interface(or multiple ones). The registrar creates a task object and gives it the subprogram to call. So far this is your standard C GUI-style "callback" interface. Now you just need to specify the procedure(s). One method is to define a subprogram access type. But the method we have used here is to define an abstract subprogram as an interface, and have the registrar pass a (classwide) pointer to the tagged object to the newly-created task. To use this system, the user just has to derive a type from the abstract class, and put his Ada procedure code in the override of the abstract method. As soon as he calls the registrar, his procedure will start getting called from its very own task automagicly! -- T.E.D. -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own