TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Classic View

Use Monospaced Font
Show HTML Part by Default
Show All Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Karl Nyberg <[log in to unmask]>
Wed, 15 Dec 2004 05:27:30 -0500
text/plain (33 lines)
   Date:         Tue, 14 Dec 2004 20:02:19 -0800
   From: Chris Sparks <[log in to unmask]>

   I am currently working on a project that is doing Ada 95 bindings to C++
   and it is a virtual nightmare.  Very high learning curve and I still
   don't think I got it.  Does anyone have a nice "cheat sheet" that
   describes a C++ object oriented ism to an Ada 95 way of doing it.

   For example:
   class A {
     int Func (const A& p1);
   }
   package A is
     type Object is tagged null record;
     function Func (This : in out Object;
                            p1   : in       Object'Class)
                                     return Integer;
   end A;

I have the benefit of going the other way right now (making C++ bindings to
Ada), and I'm using ASIS.  It's an absolute delight.

What I map is:

     private types
     tagged types
     variant records

To C++ classes.  Maybe you could consider one of those other options,
depending on whether the methods are virtual or not.

-- Karl --

ATOM RSS1 RSS2