本文整理汇总了C++中Persistent::SetClassName方法的典型用法代码示例。如果您正苦于以下问题:C++ Persistent::SetClassName方法的具体用法?C++ Persistent::SetClassName怎么用?C++ Persistent::SetClassName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Persistent
的用法示例。
在下文中一共展示了Persistent::SetClassName方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Initialize
void Query::Initialize(Handle<Object> target) {
HandleScope scope;
constructor = Persistent<FunctionTemplate>::New(FunctionTemplate::New(Query::New));
constructor->InstanceTemplate()->SetInternalFieldCount(1);
constructor->SetClassName(String::NewSymbol("Query"));
target->Set(String::NewSymbol("Query"),constructor->GetFunction());
}
示例2: Initialize
// initialize a JS wrapper around this object
void NodeFSEvents::Initialize(Handle<Object> target)
{
HandleScope scope;
emit_sym = NODE_PSYMBOL("emit");
change_sym = NODE_PSYMBOL("fsevent");
Local<FunctionTemplate> t = FunctionTemplate::New(NodeFSEvents::New);
constructor_template = Persistent<FunctionTemplate>::New(t);
constructor_template->InstanceTemplate()->SetInternalFieldCount(1);
constructor_template->SetClassName(String::NewSymbol("FSEvents"));
Local<Function> constructor = constructor_template->GetFunction();
constructor->Set(String::New("kFSEventStreamEventFlagNone"), Integer::New(0x00000000));
constructor->Set(String::New("kFSEventStreamEventFlagMustScanSubDirs"), Integer::New(0x00000001));
constructor->Set(String::New("kFSEventStreamEventFlagUserDropped"), Integer::New(0x00000002));
constructor->Set(String::New("kFSEventStreamEventFlagKernelDropped"), Integer::New(0x00000004));
constructor->Set(String::New("kFSEventStreamEventFlagEventIdsWrapped"), Integer::New(0x00000008));
constructor->Set(String::New("kFSEventStreamEventFlagHistoryDone"), Integer::New(0x00000010));
constructor->Set(String::New("kFSEventStreamEventFlagRootChanged"), Integer::New(0x00000020));
constructor->Set(String::New("kFSEventStreamEventFlagMount"), Integer::New(0x00000040));
constructor->Set(String::New("kFSEventStreamEventFlagUnmount"), Integer::New(0x00000080));
constructor->Set(String::New("kFSEventStreamEventFlagItemCreated"), Integer::New(0x00000100));
constructor->Set(String::New("kFSEventStreamEventFlagItemRemoved"), Integer::New(0x00000200));
constructor->Set(String::New("kFSEventStreamEventFlagItemInodeMetaMod"), Integer::New(0x00000400));
constructor->Set(String::New("kFSEventStreamEventFlagItemRenamed"), Integer::New(0x00000800));
constructor->Set(String::New("kFSEventStreamEventFlagItemModified"), Integer::New(0x00001000));
constructor->Set(String::New("kFSEventStreamEventFlagItemFinderInfoMod"), Integer::New(0x00002000));
constructor->Set(String::New("kFSEventStreamEventFlagItemChangeOwner"), Integer::New(0x00004000));
constructor->Set(String::New("kFSEventStreamEventFlagItemXattrMod"), Integer::New(0x00008000));
constructor->Set(String::New("kFSEventStreamEventFlagItemIsFile"), Integer::New(0x00010000));
constructor->Set(String::New("kFSEventStreamEventFlagItemIsDir"), Integer::New(0x00020000));
constructor->Set(String::New("kFSEventStreamEventFlagItemIsSymlink"), Integer::New(0x00040000));
target->Set(String::NewSymbol("FSEvents"), constructor);
}
示例3: Initialize
void Engine::Initialize(Handle<Object> target) {
HandleScope scope;
constructor = Persistent<FunctionTemplate>::New(FunctionTemplate::New(Engine::New));
constructor->InstanceTemplate()->SetInternalFieldCount(1);
constructor->SetClassName(String::NewSymbol("Engine"));
NODE_SET_PROTOTYPE_METHOD(constructor, "run", run);
NODE_SET_PROTOTYPE_METHOD(constructor, "runSync", run);
target->Set(String::NewSymbol("Engine"),constructor->GetFunction());
}
示例4: Init
static void Init(Handle<Object> target)
{
s_ct = Persistent<FunctionTemplate>::New(FunctionTemplate::New(New));
s_ct->InstanceTemplate()->SetInternalFieldCount(1);
s_ct->SetClassName(String::NewSymbol("HelloWorld"));
NODE_SET_PROTOTYPE_METHOD(s_ct, "hi", Hello);
target->Set(String::NewSymbol("HelloWorld"),
s_ct->GetFunction());
}
示例5: Init
static void Init(Handle<Object> target)
{
s_ct = Persistent<FunctionTemplate>::New(FunctionTemplate::New(New));
s_ct->InstanceTemplate()->SetInternalFieldCount(1);
s_ct->SetClassName(String::NewSymbol("Scws"));
// bind methods
NODE_SET_PROTOTYPE_METHOD(s_ct, "segment", segment);
// expose class as Scws
target->Set(String::NewSymbol("Scws"), s_ct->GetFunction());
}
示例6: Init
static void Init(Handle<Object> target) {
HandleScope scope;
Local<FunctionTemplate> t = FunctionTemplate::New(New);
s_ct = Persistent<FunctionTemplate>::New(t);
s_ct->InstanceTemplate()->SetInternalFieldCount(1);
s_ct->SetClassName(String::NewSymbol("Lucene"));
NODE_SET_PROTOTYPE_METHOD(s_ct, "addDocument", AddDocumentAsync);
NODE_SET_PROTOTYPE_METHOD(s_ct, "search", SearchAsync);
target->Set(String::NewSymbol("Lucene"), s_ct->GetFunction());
}
示例7: Initialize
void NodeRTree::Initialize(Handle<Object> target) {
HandleScope scope;
Local<FunctionTemplate> t = FunctionTemplate::New(New);
s_ct = Persistent<FunctionTemplate>::New(t);
s_ct->InstanceTemplate()->SetInternalFieldCount(1);
s_ct->SetClassName(String::NewSymbol("RTree"));
NODE_SET_PROTOTYPE_METHOD(s_ct, "insertData", InsertData);
target->Set(String::NewSymbol("RTree"), s_ct->GetFunction());
}
示例8: Init
static void Init(Handle<Object> target){
HandleScope scope;
Local<FunctionTemplate> t = FunctionTemplate::New(New);
s_ct = Persistent<FunctionTemplate>::New(t);
s_ct->InstanceTemplate()->SetInternalFieldCount(1);
s_ct->SetClassName(String::NewSymbol("Connection"));
NODE_SET_PROTOTYPE_METHOD(s_ct, "Connect", Connect);
NODE_SET_PROTOTYPE_METHOD(s_ct, "Subscribe", Subscribe);
NODE_SET_PROTOTYPE_METHOD(s_ct, "Publish", Publish);
target->Set(String::NewSymbol("Connection"), s_ct->GetFunction());
}
示例9: Initialize
void NodeFFT::Initialize (Handle<Object> target) {
HandleScope scope;
Local<FunctionTemplate> t = FunctionTemplate::New(New);
fft_constructor_template = Persistent<FunctionTemplate>::New(t);
fft_constructor_template->InstanceTemplate()->SetInternalFieldCount(1);
fft_constructor_template->SetClassName(String::NewSymbol("FFT"));
NODE_SET_PROTOTYPE_METHOD(fft_constructor_template, "forward", Forward);
NODE_SET_PROTOTYPE_METHOD(fft_constructor_template, "forwardCplx", ForwardCplx);
NODE_SET_PROTOTYPE_METHOD(fft_constructor_template, "inverse", Forward);
NODE_SET_PROTOTYPE_METHOD(fft_constructor_template, "inverseCplx", InverseCplx);
target->Set(String::NewSymbol("FFT"), fft_constructor_template->GetFunction());
}
示例10: Init
static void Init(Handle<Object> target) {
PRINTF("Entering Init\n");
PRINTF("EV_DEFAULT_ = %s\n", TEST_EV_DEFAULT_NAME);
HandleScope scope;
Local<FunctionTemplate> t = FunctionTemplate::New(New);
ct = Persistent<FunctionTemplate>::New(t);
ct->InstanceTemplate()->SetInternalFieldCount(1);
ct->SetClassName(String::NewSymbol("Pollpri"));
target->Set(String::NewSymbol("Pollpri"), ct->GetFunction());
target->Set(String::NewSymbol("delay"),
FunctionTemplate::New(delay)->GetFunction());
PRINTF("Leaving Init\n");
}
示例11: Initialize
void QuickWindowWrap::Initialize(Handle<Object> target)
{
HandleScope scope;
Local<String> name = String::NewSymbol("QuickWindow");
/* Constructor template */
Persistent<FunctionTemplate> tpl = Persistent<FunctionTemplate>::New(FunctionTemplate::New(QuickWindowWrap::New));
tpl->InstanceTemplate()->SetInternalFieldCount(1);
tpl->SetClassName(name);
/* Prototype */
NODE_SET_PROTOTYPE_METHOD(tpl, "show", QuickWindowWrap::show);
NODE_SET_PROTOTYPE_METHOD(tpl, "toObject", QuickWindowWrap::toObject);
constructor = Persistent<Function>::New(tpl->GetFunction());
target->Set(name, constructor);
}
示例12: Init
static void NODE_EXTERN Init(Handle<Object> target)
{
HandleScope scope;
// set the constructor function
Local<FunctionTemplate> t = FunctionTemplate::New(New);
// set the node.js/v8 class name
s_ct = Persistent<FunctionTemplate>::New(t);
s_ct->InstanceTemplate()->SetInternalFieldCount(1);
s_ct->SetClassName(String::NewSymbol("SharpObject"));
// registers a class member functions
NODE_SET_PROTOTYPE_METHOD(s_ct, "async", Async);
NODE_SET_PROTOTYPE_METHOD(s_ct, "async2", Async2);
NODE_SET_PROTOTYPE_METHOD(s_ct, "getSharpValue", GetSharpValue);
target->Set(String::NewSymbol("SharpObject"),
s_ct->GetFunction());
}
示例13: Init
static void NODE_EXTERN Init(Handle<Object> target)
{
HandleScope scope;
// set the constructor function
Local<FunctionTemplate> t = FunctionTemplate::New(New);
// set the node.js/v8 class name
s_ct = Persistent<FunctionTemplate>::New(t);
s_ct->InstanceTemplate()->SetInternalFieldCount(1);
s_ct->SetClassName(String::NewSymbol("tsqlftw"));
// registers a class member functions
NODE_SET_PROTOTYPE_METHOD(s_ct, "connect", connect);
NODE_SET_PROTOTYPE_METHOD(s_ct, "query", query);
NODE_SET_PROTOTYPE_METHOD(s_ct, "close", close);
target->Set(String::NewSymbol("tsqlftw"),
s_ct->GetFunction());
}