Sander van Zoest [22/03/02 11:09 -0800]:
> Now, I have another C++ class that I am trying to "inline" and
> I am curious to how I would reference the other C++ code since
> the C++ class works on an object that is an instance of the first 
> class. Is this doable? 

I'm not sure if I understand your question exactly. Is this what you're
trying to do?

----8<----
use Inline CPP => 'DATA';
use Inline CPP => 'DATA';

my $obj = new Bar;

__END__
__CPP__

class Foo {
   int getvar();
};

__CPP__

class Bar {
   int some_method(Foo *obj) { obj->getvar(); }
}
---->8----

If so, you'll have to provide the class declaration for "Foo" in the "Bar"
area, or combine the two into one __CPP__ section. Otherwise the C++ compiler
on the "Bar" area won't know what to do with Foo *s, and Inline::CPP won't
know how to typemap Foo * either. Does that make sense?

Later,
Neil

Reply via email to