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,624801e212a1e237 X-Google-Attributes: gid103376,public From: jvl@ocsystems.com (Joel VanLaven) Subject: Re: Ada bindings to C++ Date: 1996/12/07 Message-ID: <1996Dec7.002300.16247@ocsystems.com>#1/1 X-Deja-AN: 202777783 references: <32A606B9.5A66@llnl.gov> organization: OC Systems, Inc. newsgroups: comp.lang.ada Date: 1996-12-07T00:00:00+00:00 List-Id: We here at OC Systems have been working on a general-purpose C++ bindings method that involves a sort of C-code "glue" layer. We have been working on this for our Ada95 upgrade to VisualAge. I would be happy to share our bindings methodology with you. In order to get everything to work using this method we recommend an automatic bindings generator for reasons of amount of code and the importance of of correctness. Currently we do not have such a tool in a general-purpose form. However, I would be happy to give any one who wants them pointers on how to do this. If there is money involved, I am sure that we could write a tool and/or bindings :). Of course a good standard interface to C++ supported by all compilers say through the ARA ACE would be much better... Brett M. Kettering (brettk@llnl.gov) wrote: : I have written Ada bindings to C in both Ada 83 and Ada 95. The : Interfaces.C package and pragma Convention of Ada 95 really make this a : lot easier. Lately I have been considering Ada 95 bindings to C++. : Can I get some input from persons that have written Ada 95 bindings to : C++? In my readings I have learned that the C++ class construct is : analogous to the C struct. So, this would imply that a binding to a : class becomes an Ada 95 record that contains pointers to functions, as : well as the Ada 95 versions of C data, as its elements? What about : class objects that are "thrown" as exceptions? Our bindings handle this, sort-of. We catch C++ excpetions and convert them into Ada exceptions but the C++ object that is thrown is lost. All that we can save on the Ada side is a string which I suppose would in theory be able to contain an encryted version of the object, but we haven't dealt with that yet. : How does one go about using pragmas Import and Convention to bring these : functions into an Ada 95 program to be called? : Does the "c2ada" translator convert C++ header files to Ada 95 bindings? As long as they are the C subset of C++ :) : Thanks for any leads. : Brett : : -------------------------------------------------- : Brett M. Kettering : LLNL P.O. Box 808 L-493 Livermore, CA. 94550 : E-mail: brettk@llnl.gov : Voice : (510) 423-3467 : FAX : (510) 422-1930 : -------------------------------------------------- -- -- Joel VanLaven