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 Path: g2news1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: APQ Date: Fri, 17 Dec 2004 15:12:42 +0100 Message-ID: <2hju7i5ft73q$.x4md24pt913v.dlg@40tude.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: individual.net MFH4iNt2iS/Z0PeNEvjqogX/XCor5ooH3Ko4i0K/regVwYD2I= User-Agent: 40tude_Dialog/2.0.12.1 Xref: g2news1.google.com comp.lang.ada:7035 Date: 2004-12-17T15:12:42+01:00 List-Id: On Fri, 17 Dec 2004 14:45:17 +1100, Brian May wrote: > type Root_Connection_Type is abstract new Ada.Finalization.Limited_Controlled with private; If you are going to rework it, then derive it directly from an abstract object used for reference counting. That would save one level of indirection: type Root_Connection_Type is abstract new Object.Entity with private; > procedure Connect(C : in out Root_Connection_Type) is abstract; This is 100% legal. Probably you have conflicting views. > procedure Connect(C : in out Root_Connection_Type; Same_As : Root_Connection_Type'Class) is abstract; Are you going to clone connections between different DBs? The above looks like an attempt to emulate multiple dispatch.! It should be: procedure Connect ( C : in out Root_Connection_Type; Same_As : Root_Connection_Type -- Same types required! ) is abstract; However would be is pretty useless, when you have a class-wide object at hand. I suppose that the idea was to make a copy of a limited object. Then it should better be: function Copy (C : Root_Connection_Type) return Root_Connection_Ptr is abstract; This would allocate a copy and connect it to the same DB. Because reference counting is intended you will need dynamic allocation anyway. The user will of course do it all with handles: function Copy (C : Handle) return Handle is Clone_Ptr : Root_Connection_Type_Ptr := Copy (Ptr (C).all); -- This clones the object pointed by the handle, the reference -- count of the copy is initially 0 begin return Ref (Clone_Ptr); -- Result is a handle, and the reference count is 1, now end Copy; -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de