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-Thread: 103376,a3f460aaba1863e2 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Mon, 25 Jul 2005 18:55:38 -0500 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <1120752411.808598.292980@g49g2000cwa.googlegroups.com> <1121269243.013754.57720@g14g2000cwa.googlegroups.com> <1121883276.400592.326630@o13g2000cwo.googlegroups.com> <1122315253.757948.150350@z14g2000cwz.googlegroups.com> Subject: Re: Private primitive operations available to entire package hierarchy. Can it be done? Date: Mon, 25 Jul 2005 18:58:44 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4952.2800 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4952.2800 Message-ID: <8_ydncLVTeRn5njfRVn-jA@megapath.net> NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-dHh8oebOR2Kp61x+1LmrFBWlW8J3tl2Ft/PNB+syVXwdENe9I++l3LDJGLXoGU9yUkQl9AdGsdU5HOp!Dzgmyjq0eBGrWrMgclHe8NUsLwe6wrC78NRtIVYQCdphgzxJe10crmjJLWzha2GmBTuMC9Ln8+LL X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:3774 Date: 2005-07-25T18:58:44-05:00 List-Id: "Lucretia" 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.