I did read that part, but I was concerned about the fact that the library is already compiled and I onl yhave its headers to use it. So, I can’t modify the library itself anymore. The documentation sadly does not explain very well how to wrap native C++ classes with their functions and properties. Even the v8 manual (Embedders guide -> Accessors) tries to, but can’t, explain that part. I was thinking of creating a whole new object, with a property of type of the actual class. But how do I then map all the functions - and use getters and seters, if the „native“ class has like 3 of them`I have yet only seen Accessors with one property of a native class... Am Mi. Jan. 15 2014 18:41:48 schrieb Nathan Rajlich:
> You probably want to use ObjectWrap. Have you read: > http://nodejs.org/docs/latest/api/addons.html#addons_wrapping_c_objects ? > > > On Wed, Jan 15, 2014 at 1:34 AM, Kevin Ingwersen <[email protected]> > wrote: > Hallo! :) > > I want to create some nodejs bindings to FLTK. But, the problem is, that I do > not want to change half the library just to extend from Node::ObjectWrap. In > fact, I have seen a rather confusing, but working, example on github to do > exactly as I wish. > > Can someone show me the basics of how this is done? For an easier example, > let’s assume the following C++ class: > > class TaskRunner { > public: > TaskRunner(std::string cmd); > bool hasExited(); > bool wait(); > int getExitCode(); > void writeTo(std::string content); > private: > bool prepairPipes(); > void destroyPipes(); > }; > > Now, imagine I can not change this class for some reason. How can I make it > accessible thru nodejs still? > > Kind regards, > Ingwie! -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
