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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,308a261188818cce,start X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!i38g2000prf.googlegroups.com!not-for-mail From: shaunpatterson@gmail.com Newsgroups: comp.lang.ada Subject: Pointers explained? Date: Mon, 30 Jul 2007 10:53:16 -0700 Organization: http://groups.google.com Message-ID: <1185817996.233395.150610@i38g2000prf.googlegroups.com> NNTP-Posting-Host: 155.219.241.10 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1185817996 8627 127.0.0.1 (30 Jul 2007 17:53:16 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 30 Jul 2007 17:53:16 +0000 (UTC) User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; InfoPath.1; .NET CLR 3.0.04506.30; .NET CLR 1.1.4322),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: i38g2000prf.googlegroups.com; posting-host=155.219.241.10; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 Xref: g2news2.google.com comp.lang.ada:1271 Date: 2007-07-30T10:53:16-07:00 List-Id: Hi I'm still relatively new to Ada -- coming from a strong C++ background. Some of this may seem stupid - and feel free to point it out to me. I am using Ada 95 - GNAT Pro 3.16a1 I have a message factory I've been screwing around with (converting it from Ada to C++). I basically have an abstract message type: type Message is abstract tagged null record; type Message_Class is access all Message'Class; then all other messages are derived from this. Now from my factory create method, I'm returning a Message_Class. This message_class is stored in another record to be handled again later: type CallbackEvent is record msg : Message_Class; ... end record; Now my basic problem -- or not really a problem -- is that to create the Message_Class I have to use "new" and allocate and deallocate memory. Now - my solution was to re-write my message factory to return a type Message'Class. However, I went to change my callback structure to: type CallbackEvent is record