octal-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octal-dev] Re: C++ glue


From: Richard Wesley Todd
Subject: [Octal-dev] Re: C++ glue
Date: Thu, 1 Jun 2000 20:14:57 -0500 (CDT)

> Splitting this into ox++preclass.h and ox++postclass.cc ended up
> working, but it seems horrible now. I'd like your opinions and
> suggestions. If the C-->C++ wrapper is unsightly but safe, I think it'll
> be okay, since machine coders won't have to look inside the wrapper. If
> the C++ wrapper as-is is unsafe/nonportable, or if there's a much better
> way I'm just not seeing, please make yourself heard! :-). 

Great work.  I think this is a fine solution.  If the class writer makes a
.h and .cc file things even look normal:

The .h file for the new class includes ox++.h
The top of the .cc file can look like:
#include "myfile.h"
#include "ox++postclass.cc"

To put it all in a .cc file would look a little worse I guess, but I
don't think an obvious, cleaner method exists.  C++ wont do anything with
predeclared classes except pass pointers to them around, so the code HAS
to be somehow interspersed like this.

It doesn't really matter, but the preprocessor check for OX_CLASS maybe
would be more proper in ox++postclass.cc since that is where it gets used.

Regards,
Richard Todd



reply via email to

[Prev in Thread] Current Thread [Next in Thread]