Re: [orbitcpp-list] Re: cpp branch: CORBA_Object struct hidden?
- From: Michael Meeks <michael ximian com>
- To: Richard Andrews <bbmaj7 yahoo com au>
- Cc: murrayc usa net, Sam Couter <sam topic com au>,orbit <orbit-list gnome org>,orbitcpp-list <orbitcpp-list lists sourceforge net>
- Subject: Re: [orbitcpp-list] Re: cpp branch: CORBA_Object struct hidden?
- Date: 25 Feb 2002 16:06:16 +0000
Hi Richard,
On Wed, 2002-02-20 at 00:31, Richard Andrews wrote:
> --- Murray Cumming <murrayc@t-online.de> wrote:
> > 1. If a C++ class inherits from a struct, then it would make that
> > struct public to anybody who uses the C++ class.
>
> What happens if you use private inheritance?
Sigh - yes, if you use 'private' you can't poke at it; but to layout
the instance data of the object the C++ compiler hard wires the size of
the 'private' structure you inherit from making it exactly as ABI
private as having a public element ;-)
Really - we do know what we're talking about, and it just can't be any
other way, you wouldn't be able to narrow from a CORBA_Object_struct to
a Foo_Object otherwise.
> My understanding (although I haven't used private inheritance for
> years) is that this should make the internal data storage of the
> OrbitCPP_Object the same as a CORBA_Object (so casting between them
> is possible), but the storage structure will not be publicly
> available to clients of OrbitCPP_Object.
>
> Is this what you need?
Sadly not,
Michael.
--
mmeeks@gnu.org <><, Pseudo Engineer, itinerant idiot
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]