comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Private primitive operations available to entire package hierarchy. Can it be done?
Date: Mon, 25 Jul 2005 18:58:44 -0500
Date: 2005-07-25T18:58:44-05:00	[thread overview]
Message-ID: <8_ydncLVTeRn5njfRVn-jA@megapath.net> (raw)
In-Reply-To: 1122315253.757948.150350@z14g2000cwz.googlegroups.com

"Lucretia" <lucretia9@lycos.co.uk> wrote in message
news:1122315253.757948.150350@z14g2000cwz.googlegroups.com...
> Erm, they are tagged and in some cases I have needed "aliased" to get
> hold of the actual address of the item, i.e. when connecting an event
> handler to a frame, you have to give it the address of the event
> handler, the lib currently uses this address internally as well.

Tagged parameters are automatically aliased, so you don't need to declare
them explicitly. So it's only necessarily if you're declaring objects
(either stand-alone or components). I'd suggest that that be kept to a
minimum; it's best to let the user code manage the actual objects (which
often will be extensions of some sort). So it should be rare to need to
specify aliased.

In your above description, I'm assuming that the event handler and the frame
are objects passed in to the various routines. In that case, just taking
'Unchecked_Access works fine. If the event handler is some sort of local
object, then of course you'd need aliased. But in this case, this is an Ada
object, but it isn't an "object" in the software engineering sense from
outside of the library. It's not unusual to have to do all sorts of grunge
inside the library, but that's irrelevant. It's not important that *you*
have to declare something aliased; it only matters that you don't force your
users to do so. As long as objects are tagged, that should be the case.

> The lib is already a thick binding:
>
> 1) A mirror of the class hierarchy from C++ into Ada tagged types.
> 2) The primitive operations call imported C functions which in turn
> call the necessary C++ methods.
> 3) Conversions between Ada and C types is done inside the lib and you
> never deal with a C.int/long or chars_ptr.

Sounds good. Good luck with the design.

                                Randy.






  reply	other threads:[~2005-07-25 23:58 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-07 16:06 Private primitive operations available to entire package hierarchy. Can it be done? Lucretia
2005-07-07 16:17 ` OT: Joke Adrien Plisson
2005-07-07 16:24   ` Matthew Heaney
2005-07-07 19:10 ` Private primitive operations available to entire package hierarchy. Can it be done? Randy Brukardt
2005-07-13 15:40   ` Lucretia
2005-07-19 23:19     ` Randy Brukardt
2005-07-20 18:14       ` Lucretia
2005-07-21  3:10         ` Randy Brukardt
2005-07-25 18:14           ` Lucretia
2005-07-25 23:58             ` Randy Brukardt [this message]
2005-07-27 17:36               ` Lucretia
2005-07-27 21:28                 ` Randy Brukardt
2005-07-28 10:09                   ` Lucretia
2005-07-29  0:40                     ` Randy Brukardt
2005-08-02 15:55                       ` Lucretia
2005-08-03 18:26                         ` Lucretia
2005-08-03 20:04                           ` Randy Brukardt
2005-08-03 20:03                         ` Randy Brukardt
2005-08-08 18:04                           ` Lucretia
2005-08-08 20:47                             ` Randy Brukardt
replies disabled

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