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,a3eb57f922d7562d,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-11 10:48:27 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: Volkert.Barr@freenet.de (Volkert) Newsgroups: comp.lang.ada Subject: GNAT/Interfacing C++/Dispatching Date: 11 Nov 2001 10:48:27 -0800 Organization: http://groups.google.com/ Message-ID: NNTP-Posting-Host: 62.104.208.89 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1005504507 26818 127.0.0.1 (11 Nov 2001 18:48:27 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 11 Nov 2001 18:48:27 GMT Xref: archiver1.google.com comp.lang.ada:16285 Date: 2001-11-11T18:48:27+00:00 List-Id: Hello c.l.a. Is this true, that dispatching works not across languages boundaries when interfacing Ada 95 with C++ (using C++ Interface mechanisms of GNAT 3.13p.)? Example: C++ class A { void f() { g(); }; virtual void g() { // do something } } Ada: package A_Type is -- corresponds to C++ Class A type A is tagged record ... Vptr : Interfacing.CPP.Vtable_Ptr; end record; pragma CPP_Class ... pragma CPP_Vtable ... procedure f (Self : in A'Class); pragma Import(CPP, f, ...); procedure g (Self: in A); pragma CPP_Virtual (g); pragma Import(CPP, ...) end A_Type; -- extends A package B_Type is type B is new A with ... procedure g (Self : in B); -- redefines g of A. ... end B_Type; with ... procedure Main is Object : aliased B; begin -- ERROR (?) f(Object); -- calls c++ method g, -- not the primitive g of the tagged type B. end; Any hints? With regards, Volkert Barr