comp.lang.ada
 help / color / mirror / Atom feed
From: Thomas Schmidt <tc.schmidt@gmx.net>
Subject: Re: Howto declare an Ada container with access to objects of a class hierachy
Date: Thu, 13 Jun 2013 12:12:51 +0000 (UTC)
Date: 2013-06-13T12:12:51+00:00	[thread overview]
Message-ID: <489076187392817886.093028tc.schmidt-gmx.net@news1.open-news-network.org> (raw)
In-Reply-To: 96caa993-0ba4-47da-b337-9aa1c7068029@googlegroups.com

Adam Beneschan <adam@irvine.com> wrote:
> [Sorry if this is a double post.  Google is being obstinate.]
> 
> On Wednesday, June 12, 2013 5:43:22 PM UTC-7, Thomas Schmidt wrote:
> 
>> Hi,
>> 
>> Hoping this Is the right newsgroup for asking my question. 
> 
> Yes, it is.  Welcome.
>  
>> I want to set up a hashed set of accesses (allocated from heap) to objects 
>> of a given class hierarchie (the top class may f.e. be called "Top"). I 
>> decided to use "Ada.Containers.Indefinite_Hashed_Sets". The hash method 
>> should be a primitive which may be overwritten by derived classes. I've 
>> declared Tops hash functions formal parameter as of type "access Top". How 
>> do I've to declare the sets Element_Type? I think if I use "Top'Access" it 
>> wouldn't fit the hash functions 
>> parameter type nor could I store objects of classes derived from "Top". 
> 
> First of all: I'm assuming that when you want a set of "accesses to
> objects", you really mean that you want to work with your own accesses
> (Ada's term for pointer), and you're going to allocate them yourself
> with a "new" operator.  
> [...]
> I realize this is a bit complicated.  Hope this helps,
> 
>                              -- Adam

Thank you very much! Your tips and hints are very precise and helped a lot.
Now everything is running as I've expected.

Thomas

      reply	other threads:[~2013-06-13 12:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-13  0:43 Howto declare an Ada container with access to objects of a class hierachy Thomas Schmidt
2013-06-13  1:46 ` Adam Beneschan
2013-06-13 12:12   ` Thomas Schmidt [this message]
replies disabled

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