When you want to make functions of a C++ class accessible many
repeating code (e.g. for unwrapping) has to be written. To make this
more easy i've wrote a nice template class called CppWrapper.
With this you only have to map the C++ name to a name in JavaScript.
Example:
v8::CppWrapper<Point> point_wrapper;
point_wrapper.SetAccessor<int>("x", &Point::getX, &Point::setX);
point_wrapper.SetAccessor<int>("y", &Point::getY, &Point::setY);
point_wrapper.SetFunction<bool>("isNull", &Point::isNull);
Downloadable at:
http://paroga.com/v8cppwrapper.h
Maybe it will become a part of v8.
Kind Regards
Patrick
--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---