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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,39a8b74d496a2bbc X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Can ADA95 inherit from C++ classes Date: 1997/09/19 Message-ID: #1/1 X-Deja-AN: 273895354 References: <5vltvf$q1m$1@news.cc.ucf.edu> <34212D90.318E@gsfc.nasa.gov> Organization: New York University Newsgroups: comp.lang.ada Date: 1997-09-19T00:00:00+00:00 List-Id: Stephen said <> Just to make sure that things are clear, GNAT *can* import C++ classes, including multiply inherited classes from C++, treat them as tagged types, extend them with new primitive operations, and pass the resulting tagged type back to C++ to be treated as an extended class. However, this is a complex mechanism, and has to be tailored to a particular C++ compiler, since it obviously depends on Ada and C++ using identical data structures for the objects. This tailoring is done by modifying the body, and possibly the private part of the package Interfaces.CPP. Furthermore, to use the interfacing capability, a rather complex set of pragmas is required. These pragmas can be generated by hand, but it is a tricky process. SGI has a binding generator that automatically generates these pragmas for their Delta C++ technology compiler used together with GNAT. People have experimented successfully with example bindings to C++ in other environments (e.g. Microsoft C++), but for this feature to be fully usable, a binding generator is most desirable. Such a binding generator is not a trivial tool, since it needs full understanding of the C++ sources, and must therefore be built around a C++ front end. Ada Core Technologies hopes to introduce a binding generator capable of handling this problem some time in the future, but there is no definite schedule for this work. Meanwhile, it is most certainly possible to import C++ classes as packages, if necessary by using a C wrapper to ensure maximum portability.