2010-06-27 3 views
6

Ich bin mir nicht sicher, ob ich die Architektur von V8 verstehe (ja, ich habe die Dokumentation gelesen).Die Architektur von Google V8 verstehen

In C# mit dem v8sharp Wrapper ich so etwas schreiben, zum Beispiel:

namespace App 
{ 
    class Point 
    { 
     public Point() { } 

     public Point(double x, double y) { 
      this.X = x; 
      this.Y = y; 
     } 

     public double X { get; set; } 
     public double Y { get; set; } 
    } 
} 

static class Program 
{ 
    static void Main() { 
     //registering with v8sharp 
     V8Engine engine = V8Engine.Create();   
     engine.Register<App.Point>(); 

     //execute javascript 
     object rtn = engine.Execute("new App.Point(10, 10);"); 
    } 
} 

Wie würde ich die gleiche Sache in Standard C++ schreiben, ohne diesen Wrapper?

Danke.

+0

identisch ist habe ich nicht mit V8 gearbeitet, aber ich frage mich, ob durch Dokumentation, Sie bedeutet, dass Sie haben Außerdem wurde das Beispiel process.cc (http://code.google.com/p/v8/source/browse/trunk/samples/process.cc) und api.h (http://code.google.com /p/v8/source/browse/trunk/src/api.h)? –

Antwort