I guess someone will tell me Inline::CPP, but for some reason I'm not going to use it. I've also read the code of Inline::CPP, but failed to understand it.
I know perl has XS to work with C functions. However, how to use XS with the OO features in C++? Can I wrap a method indirectly like this?
The C++ class:
class Foo {
void some_method(int arg) {
do_something;
}
};
And a C wrapper:
void some_method(SV* self, int arg) {
// can I store the pointer as IV?
SV* inner = SvRV(self);
Foo* obj = (Foo*) SvIV(inner);
obj->some_method(arg);
}
and then simply write XS for that C wrapper?