On Tue, Mar 17, 2009 at 6:24 PM, luiskarlos <[email protected]> wrote: > Hi Stephan, nice example, if you are looking for generic bindings, may > be you can look at my project cProxyV8, the idea is to provide a > smooth and simple way to expose variables a methods > > ProxyClass<Foo>* pFoo = ProxyClass<Foo>::instance(); > pFoo->Expose(&Foo::bar, "bar", true, true);//Expose property Foo::bar > with name "bar" for read and write
Hi! The tiny problem there is that you're passing a member pointer at runtime and that requires (as far as i'm aware) creating a tiny call translator object to store the binding in. By using the member types as *template arguments*, my binder doesn't need to create any intermediary binding objects - it generates all the static functions it needs during the compilation (and can inline most of the conversions, which are all tiny templates). :) > Here is a link to a simple example: > http://code.google.com/p/cproxyv8/wiki/Usage?ts=1237310504&updated=Usage "Expose" is a good word for the functionality - i'll have to consider renaming my API :). There's more on that topic here: http://code.google.com/p/v8-juice/wiki/CreatingJSClasses http://code.google.com/p/v8-juice/wiki/ClassBinder -- ----- stephan beal http://wanderinghorse.net/home/stephan/ --~--~---------~--~----~------------~-------~--~----~ v8-users mailing list [email protected] http://groups.google.com/group/v8-users -~----------~----~----~----~------~----~------~--~---
