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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!mx05.eternal-september.org!feeder.eternal-september.org!news.albasani.net!.POSTED!not-for-mail From: Thomas Schmidt Newsgroups: comp.lang.ada 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) Organization: albasani.net Message-ID: <489076187392817886.093028tc.schmidt-gmx.net@news1.open-news-network.org> References: <96caa993-0ba4-47da-b337-9aa1c7068029@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: news.albasani.net G/TfUyLNJdzjkP9X46yuW2pSBIahSgDhxJBZnLVoIOBaoN63bc9mmjL+BZh6tjFkHK79VJaRMbDTWE/8k6667yu1UW+4rdLQhE7JYVjrrVh5CezS3KNGLntW/onUfI1w NNTP-Posting-Date: Thu, 13 Jun 2013 12:12:51 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="Q+obQaVemu8a2bI3nJp9fkwbgNW+XIdNeTZQ4HM0XmehHZZ43se8PQOAXo0EXuC2f7u/btUg47gnepIJ7WvJ+bJyUSR/GdkbeRAU8uqPMW3JDZU3pzmZnIYcuSGyD7y5"; mail-complaints-to="abuse@albasani.net" User-Agent: NewsTap/4.0.1 (iPad) Cancel-Lock: sha1:Zzdu7atjLHZQKTZ8JwpsIIsMQCI= Xref: news.eternal-september.org comp.lang.ada:15741 Date: 2013-06-13T12:12:51+00:00 List-Id: Adam Beneschan 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