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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8a3e2ce4e6d56336 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-09 19:26:05 PST Path: supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!arclight.uoregon.edu!wn4feed!worldnet.att.net!135.173.83.71!wnfilter1!worldnet-localpost!bgtnsc04-news.ops.worldnet.att.net.POSTED!not-for-mail Message-ID: <3AA99F09.5A2C39DB@worldnet.att.net> From: James Rogers X-Mailer: Mozilla 4.76 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Generic Formal Parameter for a Task Type References: <3AA8698B.79E68E1C@worldnet.att.net> <3AA95037.77EFEBFA@averstar.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Sat, 10 Mar 2001 03:25:01 GMT NNTP-Posting-Host: 12.74.156.61 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc04-news.ops.worldnet.att.net 984194701 12.74.156.61 (Sat, 10 Mar 2001 03:25:01 GMT) NNTP-Posting-Date: Sat, 10 Mar 2001 03:25:01 GMT Organization: AT&T Worldnet Xref: supernews.google.com comp.lang.ada:5596 Date: 2001-03-10T03:25:01+00:00 List-Id: Yes, each of these is a possible way to create a system for monitoring and controlling a set of tasks. I like your idea of the abstract limited tagged type containing a "Task_ID" function. Unfortunately, this still adds a lot of overhead when all I want to do is monitor and control the creation of tasks. Note that the problem I am trying to solve does not require much knowledge about the task, only the ability to create an instance, and the ability to query a task attribute. I fully realize the problem can be solved by building an elaborate scaffold of data and code structure. I was hoping to achieve the results simply and cleanly. I was hoping to avoid the additional overhead of code bloat resulting from building tagged types and associated subprograms. Jim Rogers Colorado Springs, Colorado USA Tucker Taft wrote: > > Why not have a formal function that returns the Task_ID, rather > than 'Terminated? That way, you can use the Ada.Task_Identification > and Ada.Task_Attributes packages to get whatever else you need from the > task, including task attributes... > > If you wanted to avoid generics, you could define an abstract limited > tagged type (say "Has_Task") which had various (abstract) primitive > operations, including at least a "Task_ID" function. You would then > extend from this type by adding a component of the task type of interest > (and of course override the abstract primitives as appropriate). > You could then manipulate objects of type Has_Task'Class, or references > there-to, in a "Java"-like way ;-). You could also pass in any > extension of Has_Task to a generic with a formal tagged derived type > of "type My_Task is new Has_Task with private;". > > The possibilities are endless...