本文整理汇总了C++中NODE_SET_PROTOTYPE_METHOD函数的典型用法代码示例。如果您正苦于以下问题:C++ NODE_SET_PROTOTYPE_METHOD函数的具体用法?C++ NODE_SET_PROTOTYPE_METHOD怎么用?C++ NODE_SET_PROTOTYPE_METHOD使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NODE_SET_PROTOTYPE_METHOD函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: NanScope
void ProjTransform::Initialize(Handle<Object> target) {
NanScope();
Local<FunctionTemplate> lcons = NanNew<FunctionTemplate>(ProjTransform::New);
lcons->InstanceTemplate()->SetInternalFieldCount(1);
lcons->SetClassName(NanNew("ProjTransform"));
NODE_SET_PROTOTYPE_METHOD(lcons, "forward", forward);
NODE_SET_PROTOTYPE_METHOD(lcons, "backward", backward);
target->Set(NanNew("ProjTransform"), lcons->GetFunction());
NanAssignPersistent(constructor, lcons);
}
开发者ID:davetowey,项目名称:node-mapnik,代码行数:14,代码来源:mapnik_projection.cpp
示例2: NanScope
void Expression::Initialize(Handle<Object> target) {
NanScope();
Local<FunctionTemplate> lcons = NanNew<FunctionTemplate>(Expression::New);
lcons->InstanceTemplate()->SetInternalFieldCount(1);
lcons->SetClassName(NanNew("Expression"));
NODE_SET_PROTOTYPE_METHOD(lcons, "toString", toString);
NODE_SET_PROTOTYPE_METHOD(lcons, "evaluate", evaluate);
target->Set(NanNew("Expression"), lcons->GetFunction());
NanAssignPersistent(constructor, lcons);
}
开发者ID:davetowey,项目名称:node-mapnik,代码行数:14,代码来源:mapnik_expression.cpp
示例3: NODE_SET_PROTOTYPE_METHOD
void XpcConnection::Init(v8::Handle<v8::Object> target) {
v8::HandleScope scope;
v8::Local<v8::FunctionTemplate> t = v8::FunctionTemplate::New(XpcConnection::New);
s_ct = v8::Persistent<v8::FunctionTemplate>::New(t);
s_ct->InstanceTemplate()->SetInternalFieldCount(1);
s_ct->SetClassName(v8::String::NewSymbol("XpcConnection"));
NODE_SET_PROTOTYPE_METHOD(s_ct, "setup", XpcConnection::Setup);
NODE_SET_PROTOTYPE_METHOD(s_ct, "sendMessage", XpcConnection::SendMessage);
target->Set(v8::String::NewSymbol("XpcConnection"), s_ct->GetFunction());
}
开发者ID:PolyPEDAL,项目名称:DashboardTeleoperation,代码行数:14,代码来源:XpcConnection.cpp
示例4: NODE_SET_PROTOTYPE_METHOD
void ZipFile::Initialize(Handle<Object> target) {
constructor = Persistent<FunctionTemplate>::New(FunctionTemplate::New(ZipFile::New));
constructor->InstanceTemplate()->SetInternalFieldCount(1);
constructor->SetClassName(String::NewSymbol("ZipFile"));
// functions
NODE_SET_PROTOTYPE_METHOD(constructor, "open", Open);
NODE_SET_PROTOTYPE_METHOD(constructor, "read", Read);
NODE_SET_PROTOTYPE_METHOD(constructor, "readFileSync", readFileSync);
NODE_SET_PROTOTYPE_METHOD(constructor, "close", Close);
NODE_SET_PROTOTYPE_METHOD(constructor, "addFile", Add_File);
NODE_SET_PROTOTYPE_METHOD(constructor, "replaceFile", Replace_File);
NODE_SET_PROTOTYPE_METHOD(constructor, "addDirectory", Add_Directory);
NODE_SET_PROTOTYPE_METHOD(constructor, "save", Save);
// properties
constructor->InstanceTemplate()->SetAccessor(String::NewSymbol("count"), get_prop);
constructor->InstanceTemplate()->SetAccessor(String::NewSymbol("names"), get_prop);
// Initiate async handler
ev_async_init(¬ifier, Save_Callback);
ev_async_start(EV_DEFAULT_UC_ ¬ifier);
target->Set(String::NewSymbol("ZipFile"),constructor->GetFunction());
}
开发者ID:toots,项目名称:node-zipfile,代码行数:26,代码来源:node_zipfile.cpp
示例5: NODE_SET_PROTOTYPE_METHOD
Handle<Object> FixSession::wrapFixSession(FixSession* fixSession) {
Local<FunctionTemplate> ctor = NanNew<FunctionTemplate>();
ctor->InstanceTemplate()->SetInternalFieldCount(1);
ctor->SetClassName(NanNew("FixSession"));
Local<ObjectTemplate> proto = ctor->PrototypeTemplate();
NODE_SET_PROTOTYPE_METHOD(ctor, "disconnect", disconnect);
NODE_SET_PROTOTYPE_METHOD(ctor, "getSessionID", getSessionID);
NODE_SET_PROTOTYPE_METHOD(ctor, "isEnabled", isEnabled);
NODE_SET_PROTOTYPE_METHOD(ctor, "isLoggedOn", isLoggedOn);
NODE_SET_PROTOTYPE_METHOD(ctor, "logon", logon);
NODE_SET_PROTOTYPE_METHOD(ctor, "logout", logout);
NODE_SET_PROTOTYPE_METHOD(ctor, "refresh", refresh);
NODE_SET_PROTOTYPE_METHOD(ctor, "reset", reset);
proto->SetAccessor(NanNew("senderSeqNum"), getSenderSeqNum, setSenderSeqNum);
proto->SetAccessor(NanNew("targetSeqNum"), getTargetSeqNum, setTargetSeqNum);
Handle<Object> obj = ctor->InstanceTemplate()->NewInstance();
//obj->SetAlignedPointerInInternalField(0, NanNew<External>(fixSession));
fixSession->Wrap(obj);
return obj;
}
开发者ID:Luka111,项目名称:node-fix-middleware,代码行数:26,代码来源:FixSession.cpp
示例6: NODE_SET_PROTOTYPE_METHOD
void MultiPoint::Initialize(Handle<Object> target)
{
HandleScope scope;
constructor = Persistent<FunctionTemplate>::New(FunctionTemplate::New(MultiPoint::New));
constructor->Inherit(GeometryCollection::constructor);
constructor->InstanceTemplate()->SetInternalFieldCount(1);
constructor->SetClassName(String::NewSymbol("MultiPoint"));
NODE_SET_PROTOTYPE_METHOD(constructor, "toString", toString);
NODE_SET_PROTOTYPE_METHOD(constructor, "getGeometry", getGeometry);
target->Set(String::NewSymbol("MultiPoint"), constructor->GetFunction());
}
开发者ID:jarped,项目名称:node-gdal,代码行数:14,代码来源:gdal_multipoint.cpp
示例7: NODE_SET_PROTOTYPE_METHOD
void OracleClient::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("OracleClient"));
NODE_SET_PROTOTYPE_METHOD(s_ct, "connect", Connect);
NODE_SET_PROTOTYPE_METHOD(s_ct, "connectSync", ConnectSync);
NODE_SET_PROTOTYPE_METHOD(s_ct, "createConnectionPoolSync", CreateConnectionPoolSync);
NODE_SET_PROTOTYPE_METHOD(s_ct, "createConnectionPool", CreateConnectionPool);
target->Set(String::NewSymbol("OracleClient"), s_ct->GetFunction());
}
开发者ID:strongloop-forks,项目名称:node-oracle,代码行数:15,代码来源:oracle_bindings.cpp
示例8: NODE_SET_PROTOTYPE_METHOD
void FreeImage::Initialize(Handle<Object> target) {
HandleScope scope;
Local<FunctionTemplate> t = FunctionTemplate::New(New);
constructor_template = Persistent<FunctionTemplate>::New(t);
constructor_template->InstanceTemplate()->SetInternalFieldCount(1);
constructor_template->SetClassName(JS_STR("FreeImage"));
NODE_SET_PROTOTYPE_METHOD(constructor_template, "getVersion", getVersion);
NODE_SET_PROTOTYPE_METHOD(constructor_template, "load", load);
NODE_SET_PROTOTYPE_METHOD(constructor_template, "save", save);
target->Set(JS_STR("FreeImage"), constructor_template->GetFunction());
}
开发者ID:davidlehn,项目名称:node-image,代码行数:15,代码来源:FreeImage.cpp
示例9: NanScope
void CoordinateTransformation::Initialize(Handle<Object> target)
{
NanScope();
Local<FunctionTemplate> lcons = NanNew<FunctionTemplate>(CoordinateTransformation::New);
lcons->InstanceTemplate()->SetInternalFieldCount(1);
lcons->SetClassName(NanNew("CoordinateTransformation"));
NODE_SET_PROTOTYPE_METHOD(lcons, "toString", toString);
NODE_SET_PROTOTYPE_METHOD(lcons, "transformPoint", transformPoint);
target->Set(NanNew("CoordinateTransformation"), lcons->GetFunction());
NanAssignPersistent(constructor, lcons);
}
开发者ID:mojodna,项目名称:node-gdal,代码行数:15,代码来源:gdal_coordinate_transformation.cpp
示例10: NODE_SET_PROTOTYPE_METHOD
void ZipFile::Initialize(Handle<Object> target) {
HandleScope scope;
constructor = Persistent<FunctionTemplate>::New(FunctionTemplate::New(ZipFile::New));
constructor->InstanceTemplate()->SetInternalFieldCount(1);
constructor->SetClassName(String::NewSymbol("ZipFile"));
// functions
NODE_SET_PROTOTYPE_METHOD(constructor, "readFileSync", readFileSync);
NODE_SET_PROTOTYPE_METHOD(constructor, "readFile", readFile);
// properties
constructor->InstanceTemplate()->SetAccessor(String::NewSymbol("count"), get_prop);
constructor->InstanceTemplate()->SetAccessor(String::NewSymbol("names"), get_prop);
target->Set(String::NewSymbol("ZipFile"), constructor->GetFunction());
}
开发者ID:anoopsinha,项目名称:maui-epub,代码行数:16,代码来源:node_zipfile.cpp
示例11: Init
static void Init(v8::Handle<v8::Object> exports) {
v8::Isolate* isolate = Isolate::GetCurrent();
// Prepare constructor template
v8::Local<v8::FunctionTemplate> tpl = FunctionTemplate::New(isolate, New);
tpl->SetClassName(v8::String::NewFromUtf8(isolate, "Filters"));
tpl->InstanceTemplate()->SetInternalFieldCount(1);
// Prototype
NODE_SET_PROTOTYPE_METHOD(tpl, "isAvailable", isAvailable);
NODE_SET_PROTOTYPE_METHOD(tpl, "getNFilters", getNFilters);
NODE_SET_PROTOTYPE_METHOD(tpl, "getFilter", getFilter);
Constructor.Reset(v8::Isolate::GetCurrent(), tpl);
exports->Set(v8::String::NewFromUtf8(isolate, "Filters"), tpl->GetFunction());
}
开发者ID:hdfeos,项目名称:hdf5.node,代码行数:16,代码来源:filters.hpp
示例12: NanScope
void MultiLineString::Initialize(Handle<Object> target)
{
NanScope();
Local<FunctionTemplate> lcons = NanNew<FunctionTemplate>(MultiLineString::New);
lcons->Inherit(NanNew(GeometryCollection::constructor));
lcons->InstanceTemplate()->SetInternalFieldCount(1);
lcons->SetClassName(NanNew("MultiLineString"));
NODE_SET_PROTOTYPE_METHOD(lcons, "toString", toString);
NODE_SET_PROTOTYPE_METHOD(lcons, "polygonize", polygonize);
target->Set(NanNew("MultiLineString"), lcons->GetFunction());
NanAssignPersistent(constructor, lcons);
}
开发者ID:mojodna,项目名称:node-gdal,代码行数:16,代码来源:gdal_multilinestring.cpp
示例13: NODE_SET_PROTOTYPE_METHOD
void Polygon::Initialize(Handle<Object> target)
{
HandleScope scope;
constructor = Persistent<FunctionTemplate>::New(FunctionTemplate::New(Polygon::New));
constructor->Inherit(Geometry::constructor);
constructor->InstanceTemplate()->SetInternalFieldCount(1);
constructor->SetClassName(String::NewSymbol("Polygon"));
NODE_SET_PROTOTYPE_METHOD(constructor, "toString", toString);
NODE_SET_PROTOTYPE_METHOD(constructor, "getArea", getArea);
ATTR(constructor, "rings", ringsGetter, READ_ONLY_SETTER);
target->Set(String::NewSymbol("Polygon"), constructor->GetFunction());
}
开发者ID:jarped,项目名称:node-gdal,代码行数:16,代码来源:gdal_polygon.cpp
示例14: scope
void GeometryFactory::Initialize(Handle<Object> target) {
Isolate* isolate = Isolate::GetCurrent();
HandleScope scope(isolate);
Local<FunctionTemplate> tpl = FunctionTemplate::New(isolate, GeometryFactory::New);
tpl->InstanceTemplate()->SetInternalFieldCount(1);
tpl->SetClassName(String::NewFromUtf8(isolate, "GeometryFactory"));
NODE_SET_PROTOTYPE_METHOD(tpl, "getPrecisionModel", GetPrecisionModel);
NODE_SET_PROTOTYPE_METHOD(tpl, "getSRID", GetSRID);
NODE_SET_PROTOTYPE_METHOD(tpl, "destroy", Destroy);
constructor.Reset(isolate, tpl->GetFunction());
target->Set(String::NewFromUtf8(isolate, "GeometryFactory"), tpl->GetFunction());
}
开发者ID:kashif,项目名称:node-geos,代码行数:16,代码来源:geometryfactory.cpp
示例15: NODE_SET_PROTOTYPE_METHOD
void StrTree::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("StrTree"));
NODE_SET_PROTOTYPE_METHOD(s_ct, "insert", Insert);
NODE_SET_PROTOTYPE_METHOD(s_ct, "remove", Remove);
NODE_SET_PROTOTYPE_METHOD(s_ct, "query", Query);
target->Set(String::NewSymbol("StrTree"), s_ct->GetFunction());
}
开发者ID:netconstructor,项目名称:node-geos,代码行数:16,代码来源:strTree.cpp
示例16: NODE_SET_PROTOTYPE_METHOD
void ImageView::Initialize(Handle<Object> target) {
HandleScope scope;
constructor = Persistent<FunctionTemplate>::New(FunctionTemplate::New(ImageView::New));
constructor->InstanceTemplate()->SetInternalFieldCount(1);
constructor->SetClassName(String::NewSymbol("ImageView"));
NODE_SET_PROTOTYPE_METHOD(constructor, "encodeSync", encodeSync);
NODE_SET_PROTOTYPE_METHOD(constructor, "encode", encode);
NODE_SET_PROTOTYPE_METHOD(constructor, "save", save);
NODE_SET_PROTOTYPE_METHOD(constructor, "width", width);
NODE_SET_PROTOTYPE_METHOD(constructor, "height", height);
target->Set(String::NewSymbol("ImageView"),constructor->GetFunction());
}
开发者ID:yhahn,项目名称:node-mapnik,代码行数:16,代码来源:mapnik_image_view.cpp
示例17: NODE_SET_PROTOTYPE_METHOD
void Datasource::Initialize(Handle<Object> target) {
HandleScope scope;
constructor = Persistent<FunctionTemplate>::New(FunctionTemplate::New(Datasource::New));
constructor->InstanceTemplate()->SetInternalFieldCount(1);
constructor->SetClassName(String::NewSymbol("Datasource"));
// methods
NODE_SET_PROTOTYPE_METHOD(constructor, "parameters", parameters);
NODE_SET_PROTOTYPE_METHOD(constructor, "describe", describe);
NODE_SET_PROTOTYPE_METHOD(constructor, "features", features);
NODE_SET_PROTOTYPE_METHOD(constructor, "get_featureset", get_featureset);
target->Set(String::NewSymbol("Datasource"),constructor->GetFunction());
}
开发者ID:netconstructor,项目名称:node-mapnik,代码行数:16,代码来源:mapnik_datasource.cpp
示例18: NanScope
void FreeImage::Initialize(Handle<Object> target) {
NanScope();
// constructor
Local<FunctionTemplate> ctor = FunctionTemplate::New(FreeImage::New);
NanAssignPersistent(FunctionTemplate, constructor_template, ctor);
ctor->InstanceTemplate()->SetInternalFieldCount(1);
ctor->SetClassName(JS_STR("FreeImage"));
// prototype
Local<ObjectTemplate> proto = ctor->PrototypeTemplate();
NODE_SET_PROTOTYPE_METHOD(ctor, "load", load);
NODE_SET_PROTOTYPE_METHOD(ctor, "save", save);
proto->SetAccessor(JS_STR("getVersion"), getVersion);
target->Set(JS_STR("FreeImage"), ctor->GetFunction());
}
开发者ID:mikeseven,项目名称:node-image,代码行数:17,代码来源:FreeImage.cpp
示例19: HandleScope
/////////////////////////////////////////
// DHT11 - Digital temperature and humidity sensor
void TNodejsDHT11Sensor::Init(v8::Handle<v8::Object> Exports) {
v8::Isolate* Isolate = v8::Isolate::GetCurrent();
v8::HandleScope HandleScope(Isolate);
v8::Local<v8::FunctionTemplate> tpl = v8::FunctionTemplate::New(Isolate, TNodeJsUtil::_NewJs<TNodejsDHT11Sensor>);
tpl->SetClassName(v8::String::NewFromUtf8(Isolate, GetClassId().CStr()));
// ObjectWrap uses the first internal field to store the wrapped pointer.
tpl->InstanceTemplate()->SetInternalFieldCount(1);
// Add all methods, getters and setters here.
NODE_SET_PROTOTYPE_METHOD(tpl, "init", _init);
NODE_SET_PROTOTYPE_METHOD(tpl, "read", _read);
NODE_SET_PROTOTYPE_METHOD(tpl, "readSync", _readSync);
Exports->Set(v8::String::NewFromUtf8(Isolate, GetClassId().CStr()), tpl->GetFunction());
}
开发者ID:lstopar,项目名称:HomeDevelopment,代码行数:19,代码来源:rpinode.cpp
示例20: NODE_SET_PROTOTYPE_METHOD
void DatasetBands::Initialize(Handle<Object> target)
{
HandleScope scope;
constructor = Persistent<FunctionTemplate>::New(FunctionTemplate::New(DatasetBands::New));
constructor->InstanceTemplate()->SetInternalFieldCount(1);
constructor->SetClassName(String::NewSymbol("DatasetBands"));
NODE_SET_PROTOTYPE_METHOD(constructor, "toString", toString);
NODE_SET_PROTOTYPE_METHOD(constructor, "count", count);
//NODE_SET_PROTOTYPE_METHOD(constructor, "create", create);
NODE_SET_PROTOTYPE_METHOD(constructor, "get", get);
ATTR_DONT_ENUM(constructor, "ds", dsGetter, READ_ONLY_SETTER);
target->Set(String::NewSymbol("DatasetBands"), constructor->GetFunction());
}
开发者ID:jarped,项目名称:node-gdal,代码行数:17,代码来源:dataset_bands.cpp
注:本文中的NODE_SET_PROTOTYPE_METHOD函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论