pmed / v8pp

Bind C++ functions and classes into V8 JavaScript engine
http://pmed.github.io/v8pp/
Other
890 stars 120 forks source link

how to call js function with c++ class instance as an argument ? #70

Closed cuipeng1976 closed 6 years ago

cuipeng1976 commented 6 years ago

how to call js function with c++ class instance as an argument ?

pmed commented 6 years ago

Such a C++ class shall be wrapped with v8::class_ template. In this case the class instances may be used by as arguments and return values by pointer or reference.

Usage example: https://github.com/pmed/v8pp/tree/master/examples/08%20passing%20wrapped%20objects