Hi there,
I'm writing a little plugin that allows you to use v8 in the Ruby
programming language. Right now I'm kind of having trouble with
creating a callback to a non-static member function. Basically, the
FunctionTemplate allows me to input a callback, but it's impossible to
simply reference a member function (more about the complexities of
that here: http://www.parashift.com/c++-faq-lite/pointers-to-members.html)
However, when reading the embedder's guide, it seems that you've
solved this problem already for accessors!
"The complexity of an accessor depends upon the type of data you are
manipulating:
* Accessing Static Global Variables
* Accessing Dynamic Variables
"
For the latter, you're using a special mechanism that allows you to
define a static wrapper function, which then uses AccessorInfo to get
a reference to the object. This means that it's possible to call
member functions (dynamic functions of a class instance) when you use
accessors.
However, it is not possible to use dynamic functions when you use a
FunctionTemplate. Is this correct?
Is there any hack you can think of that allows me to do it anyway?
Providing callbacks to non-static member functions is essential for
writing scripting language extensions.
Thanks!
P.S. My C++ is a bit rusty, but I've been digging into this problem
for quite some hours now.
--
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users