in reply to Re: Re: Re: Re: XS typemap and C++ multiple inheritance
in thread XS typemap and C++ multiple inheritance

So define one base class whose only purpose is to serve as the hook to XS. Everything is dynamic_cast to that before storing in a void*, every void* is static_cast to that to restore it to the type system.

Since it has no members but lives only for this purpose, it would be an error to remove it. Adding to the type hiarachy is not an issue. Any new code must still conform to this protocol.

—John

  • Comment on Re: Re: Re: Re: Re: XS typemap and C++ multiple inheritance

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Re: XS typemap and C++ multiple inheritance
by FrenchZ (Initiate) on Aug 08, 2001 at 11:21 UTC
    With this solution, I see 2 drawbacks :

    1 - I have to add a class in my C++ hierarchy only
    for XS. And I would like to have a clear spearation
    between my C++ classes and my XS code.
    I do not want to mix both .
    Moreover, my C++ classes are not only mapped to perl but
    also to TCL.

    2 - I will need to have one typemap for each mapped classes.

    am i right ?

    -- Xavier