comp.lang.ada
 help / color / mirror / Atom feed
From: Tucker Taft <stt@avercom.net>
Subject: Re: Multiple task bodies for one task type?
Date: Mon, 17 Sep 2001 10:01:04 -0400
Date: 2001-09-17T14:01:04+00:00	[thread overview]
Message-ID: <3BA60220.9837BAB6@avercom.net> (raw)
In-Reply-To: 3ba5c37f.6210990@news.demon.co.uk

John McCabe wrote:
> 
> On Sat, 15 Sep 2001 00:26:01 GMT, Darren New <dnew@san.rr.com> wrote:
> 
> If I understand yuo correctly, what you want is a heterogeneous array
> of tasks. If that is the case, I don't believe it is supported by Ada
> as the task type is not extendable.

You could define a limited tagged type, and include a task body
in each extension.  You would need some primitive operations to
interface with the entries of the task.  An access-to-LT'Class type
could be used for passing these around conveniently, where LT is
the limited tagged type.

> ...
> You may be able to implement someting like this using a discriminant
> on the task type. You would have to include all possible variations on
> the code within a case statement in the task. There may be other ways
> of course!

The tagged type mechanism is more easily extensible, though the
interface to the task must be through primitive operations,
rather than directly with entries.

> 
> Hope this helps.

-- 
-Tucker Taft   stt@avercom.net   http://www.avercom.net
Chief Technology Officer, AverCom Corporation (A Titan Company) 
Bedford, MA  USA (AverCom was formerly the Commercial Division of AverStar:
http://www.averstar.com/~stt)



  reply	other threads:[~2001-09-17 14:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-15  0:26 Multiple task bodies for one task type? Darren New
2001-09-17  9:37 ` John McCabe
2001-09-17 14:01   ` Tucker Taft [this message]
2001-09-18 19:01   ` Richard Riehle
2001-09-18 21:03     ` Darren New
2001-09-18 21:26     ` tmoran
2001-09-17 14:15 ` Stephen Leake
replies disabled

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