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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,af92cb4b0cc736af X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-10-31 06:50:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!lnewspeer00.lnd.ops.eu.uu.net!bnewspeer01.bru.ops.eu.uu.net!bnewspost00.bru.ops.eu.uu.net!emea.uu.net!read.news.de.uu.net!not-for-mail Date: Thu, 31 Oct 2002 15:43:03 +0100 From: Ulrich Eckhardt Organization: Private at home User-Agent: Mozilla/5.0 (X11; U; Linux i686; en; Stable) Gecko/20020603 Beonex/0.8-stable X-Accept-Language: de, de-DE, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: problem with abstract types References: <3DC12CFF.EC36842C@brighton.ac.uk> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 1Cust38.tnt6.fft4.deu.da.uu.net X-Trace: 1036075629 read.news.de.uu.net 191 149.225.94.38 X-Complaints-To: abuse@de.uu.net Xref: archiver1.google.com comp.lang.ada:30259 Date: 2002-10-31T15:43:03+01:00 List-Id: John English wrote: > Ulrich Eckhardt wrote: > >>procedure main is >> reg : registry_Access; >> err : r_error; >>begin >> reg := getRegistry(CLASS_USER,To_Unbounded_String("registrytest")); >> openRegistry(reg'access,err); > Reg is already an access value; you don't need to use 'Access > at all here. I think you'll find that this works: > openRegistry(reg,err); > No. openRegistry is first defined abstract and then implemented as openRegistry(reg : in out file_registry; ..) and openRegistry(reg : in out win_registry; ..) . getRegistry should instantiate a class of file_registry or win_registry depending on the Operation System and returns this to the main programm. Within the main programm now the correct instances of openRegistry should be choosen, so that the current used implementation is not visible. So the programmer which uses the registry package shouldnt't care (and shouldn't see) whats behind the scene. Uli -- Ulrich Eckhardt http://www.uli-eckhardt.de