comp.lang.ada
 help / color / mirror / Atom feed
* Copying by dispatching on remote access to class wide types
@ 2001-04-11 17:49 Kevin Rigotti
  2001-04-12 15:37 ` Ted Dennison
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Rigotti @ 2001-04-11 17:49 UTC (permalink / raw)


What I would like to be able to do is have a function to take a local copy
of part of some remote data, of the form

    function copy(remote : Distributed_Object_T; .... ) return
Distributed_Object_T

where calls dispatch on the controlling operand "remote" which would be a
derefence of a remote access to class wide type, and NOT on the returned
value (of variable size as determined by the other arguments) which is a
local copy of part of the remote data.

This isn't valid Ada (is it?) and would get complaints about trying to
dispatch twice in one call.

I can see that one way of achieving what I want would be by associating the
Distributed Object with some other class that would accept the dispatching
call and use a supplied access value to return the data, but I can't help
feeling that I am getting myself into a bit of mess when there is probably a
perfectly straight forward way of doing it.

Suggestions?

Kevin
--
ATC Systems Group, DERA, St Andrews Road, Malvern, Worcestershire WR14 3PS,
UK
Phone +44 (0)1684 89 69 11, fax +44(0)1684 89 41 09
DERA disclaimers and restrictions apply, details on request





^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Copying by dispatching on remote access to class wide types
  2001-04-11 17:49 Copying by dispatching on remote access to class wide types Kevin Rigotti
@ 2001-04-12 15:37 ` Ted Dennison
  0 siblings, 0 replies; 2+ messages in thread
From: Ted Dennison @ 2001-04-12 15:37 UTC (permalink / raw)


In article <9b25g9$gn7$1@trog.dera.gov.uk>, Kevin Rigotti says...
>
>What I would like to be able to do is have a function to take a local copy
>of part of some remote data, of the form
>
>    function copy(remote : Distributed_Object_T; .... ) return
>Distributed_Object_T
>
>where calls dispatch on the controlling operand "remote" which would be a
>derefence of a remote access to class wide type, and NOT on the returned
>value (of variable size as determined by the other arguments) which is a
>local copy of part of the remote data.

That ought to be OK, as long as both the parameter and the return type always
end up having the same tag. At least, I know it would be OK if they were both
parameters. I haven't tried it with return values before...

If you want them to be able to have *different* tags, then you should probably
make one of them Distributed_Object_T'Class, so that it will only dispatch on
the other one. I'd suggest the return value, but it depends on exactly what you
want to do with it.

---
T.E.D.    homepage   - http://www.telepath.com/dennison/Ted/TED.html
          home email - mailto:dennison@telepath.com



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-04-12 15:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-11 17:49 Copying by dispatching on remote access to class wide types Kevin Rigotti
2001-04-12 15:37 ` Ted Dennison

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