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,2843c5eea3415584 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit From: Brian May Newsgroups: comp.lang.ada Subject: Re: APQ References: <2hju7i5ft73q$.x4md24pt913v.dlg@40tude.net> Date: Wed, 22 Dec 2004 10:29:01 +1100 Message-ID: User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:GGl83v3QMlJGNQUDk3+Qphokso4= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: snoopy.microcomaustralia.com.au X-Trace: news.melbourne.pipenetworks.com 1103671715 202.173.153.89 (22 Dec 2004 09:28:35 +1000) X-Complaints-To: abuse@pipenetworks.com X-Abuse-Info: Please forward all headers to enable your complaint to be properly processed. Path: g2news1.google.com!news4.google.com!news.glorb.com!newsfeed-east.nntpserver.com!nntpserver.com!news1.optus.net.au!optus!news.mel.connect.com.au!news-north.connect.com.au!duster.adelaide.on.net!news.melbourne.pipenetworks.com!not-for-mail Xref: g2news1.google.com comp.lang.ada:7135 Date: 2004-12-22T10:29:01+11:00 List-Id: >>>>> "Dmitry" == Dmitry A Kazakov writes: >> procedure Connect(C : in out Root_Connection_Type; Same_As : >> Root_Connection_Type'Class) is abstract; Dmitry> Are you going to clone connections between different DBs? Dmitry> The above looks like an attempt to emulate multiple Dmitry> dispatch.! I read a documentation somewhere that said the code below is not legal, and the above had to be used instead... The documentation said the code body could check the types were correct. However, on advice from Dmitry, I tried a test case with the code below, and it seems to work fine. Need to keep my eyes open for that reference. Wonder if it was that dodgy guide on the web about Ada for C++ programmers... Dmitry> It should be: Dmitry> procedure Connect Dmitry> ( C : in out Root_Connection_Type; Dmitry> Same_As : Root_Connection_Type -- Same types required! Dmitry> ) is abstract; Dmitry> However would be is pretty useless, when you have a Dmitry> class-wide object at hand. Dmitry> I suppose that the idea was to make a copy of a limited Dmitry> object. Then it should better be: Dmitry> function Copy (C : Root_Connection_Type) Dmitry> return Root_Connection_Ptr is abstract; Dmitry> This would allocate a copy and connect it to the same Dmitry> DB. Because reference counting is intended you will need Dmitry> dynamic allocation anyway. The user will of course do it Dmitry> all with handles: I have a suspicion this would not work as Root_Connection_Type is a limited type. Or am I yet again mistaken? Can somebody please let me know what applications a cloning function has? I frequently hear of such functions, but rarely (if ever) needed to use one. -- Brian May