JavaScript V8を使い始めたばかりで、 Embedder's Guideから基本的な例をコンパイルしました。次に、C++ 関数を JavaScript コンテキストにバインドします。
今のところ、後でバインドを処理する必要がある、多かれ少なかれ空のクラスしかありません。
class Manager
{
public:
Manager()
{
context = Context::New();
}
void Bind(string Name, function<Handle<Value>(const Arguments&)> Function)
{
// bind the function to the given context
}
private:
Persistent<Context> context;
};
std::function
オブジェクトを JavaScript V8 コンテキストにバインドするにはどうすればよいですか?