Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Perl wrappers for C++ classes

by flymolo42 (Initiate)
on Dec 05, 2001 at 22:19 UTC ( [id://129695]=perlquestion: print w/replies, xml ) Need Help??

flymolo42 has asked for the wisdom of the Perl Monks concerning the following question:

I'd like to create Perl binding for vtk.
It is written in c++. It has wrappers for tcl,python, and java.
I know about xs but the docs I read said it has problems with c++.
I'd like to produce something that handles double* calls unlike PerlVTK. Any helpful URLs?

Replies are listed 'Best First'.
Re: Perl wrappers for C++ classes
by cheshirecat (Sexton) on Dec 05, 2001 at 23:26 UTC
Re: Perl wrappers for C++ classes
by miyagawa (Chaplain) on Dec 05, 2001 at 23:20 UTC
Re: Perl wrappers for C++ classes
by Beatnik (Parson) on Dec 12, 2001 at 12:53 UTC
Re: Perl wrappers for C++ classes
by mortis (Pilgrim) on Dec 06, 2001 at 19:49 UTC
    It will end up being more work, but you could create C wrapper functions for the C++ calls (casting the C++ objects to a void* or something similar) and then make the C functions available through XS, which should be simpler than trying to make C++ code directly available.

    If you write your code as a perl object (module), you can store the C++ object (the void*) in the perl object, that way each of the C XS/wrapper functions would have access to the C++ object through $self which would allow you to pass it through to the C++ code.

    Does this make sense?

    HTH

    Kyle

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://129695]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2024-03-29 04:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found