Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Perl wrappers for C++ classes

by mortis (Pilgrim)
on Dec 06, 2001 at 19:49 UTC ( [id://129939]=note: print w/replies, xml ) Need Help??


in reply to Perl wrappers for C++ classes

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: note [id://129939]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-19 21:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found