本文整理汇总了C++中Arguments::GetReturnValue方法的典型用法代码示例。如果您正苦于以下问题:C++ Arguments::GetReturnValue方法的具体用法?C++ Arguments::GetReturnValue怎么用?C++ Arguments::GetReturnValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Arguments
的用法示例。
在下文中一共展示了Arguments::GetReturnValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: queryGetResult
// getResult(id, objectWrapper): IMMEDIATE
void queryGetResult(const Arguments & args) {
REQUIRE_ARGS_LENGTH(2);
v8::Isolate * isolate = args.GetIsolate();
QueryOperation * op = unwrapPointer<QueryOperation *>(args.Holder());
size_t id = args[0]->Uint32Value();
Handle<Object> wrapper = args[1]->ToObject();
QueryResultHeader * header = op->getResult(id);
if(header) {
if(header->data) {
wrapper->Set(GET_KEY(K_data),
LOCAL_BUFFER(node::Buffer::New(isolate, header->data,
op->getResultRowSize(header->depth),
doNotFreeQueryResultAtGC, 0)));
} else {
wrapper->Set(GET_KEY(K_data), Null(isolate));
}
wrapper->Set(GET_KEY(K_level), v8::Uint32::New(isolate, header->depth));
wrapper->Set(GET_KEY(K_tag), v8::Uint32::New(isolate, header->tag));
args.GetReturnValue().Set(true);
} else {
args.GetReturnValue().Set(false);
}
}
示例2: DBOperationHelper
/* DBOperationHelper takes an array of HelperSpecs.
arg0: Length of Array
arg1: Array of HelperSpecs
arg2: TransactionImpl *
arg3: Old BatchImpl wrapper (for recycling)
Returns: BatchImpl
*/
void DBOperationHelper(const Arguments &args) {
EscapableHandleScope scope(args.GetIsolate());
int length = args[0]->Int32Value();
const Local<Object> array = args[1]->ToObject();
TransactionImpl *txc = unwrapPointer<TransactionImpl *>(args[2]->ToObject());
Handle<Value> oldWrapper = args[3];
BatchImpl * pendingOps = new BatchImpl(txc, length);
for(int i = 0 ; i < length ; i++) {
Handle<Object> spec = array->Get(i)->ToObject();
int opcode = spec->Get(HELPER_OPCODE)->Int32Value();
bool is_vo = spec->Get(HELPER_IS_VO)->ToBoolean()->Value();
bool op_ok = spec->Get(HELPER_IS_VALID)->ToBoolean()->Value();
KeyOperation * op = pendingOps->getKeyOperation(i);
if(op_ok) {
op->opcode = opcode;
if(is_vo) DBOperationHelper_VO(spec, *op);
else DBOperationHelper_NonVO(spec, *op);
}
}
if(oldWrapper->IsObject()) {
args.GetReturnValue().Set(BatchImpl_Recycle(oldWrapper->ToObject(), pendingOps));
} else {
args.GetReturnValue().Set(BatchImpl_Wrapper(pendingOps));
}
}
示例3: createQueryOperation
/* JS QueryOperation.create(ndbRootProjection, keyBuffer, depth)
*/
void createQueryOperation(const Arguments & args) {
DEBUG_MARKER(UDEB_DEBUG);
REQUIRE_ARGS_LENGTH(3);
Isolate * isolate = Isolate::GetCurrent();
int size = args[2]->Int32Value();
QueryOperation * queryOperation = new QueryOperation(size);
const NdbQueryOperationDef * root, * current;
Local<Value> v;
Local<Object> spec = args[0]->ToObject();
setRowBuffers(queryOperation, spec);
current = root = createTopLevelQuery(queryOperation, spec,
args[1]->ToObject());
while(! (v = spec->Get(GET_KEY(K_next)))->IsNull()) {
spec = v->ToObject();
current = createNextLevel(queryOperation, spec, current);
assert(current->getOpNo() == spec->Get(GET_KEY(K_depth))->Uint32Value());
setRowBuffers(queryOperation, spec);
}
queryOperation->prepare(root);
args.GetReturnValue().Set(QueryOperation_Wrapper(queryOperation));
}
示例4: getTable
/* getTable() method call
ASYNC
arg0: Ndb *
arg1: database name
arg2: table name
arg3: user_callback
*/
void getTable(const Arguments &args) {
DEBUG_MARKER(UDEB_DETAIL);
REQUIRE_ARGS_LENGTH(4);
GetTableCall * ncallptr = new GetTableCall(args);
ncallptr->runAsync();
args.GetReturnValue().SetUndefined();
}
示例5: closeNdb
void closeNdb(const Arguments &args) {
DEBUG_MARKER(UDEB_DETAIL);
typedef NativeDestructorCall<Ndb> MCALL;
MCALL * mcallptr = new MCALL(args);
mcallptr->runAsync();
args.GetReturnValue().SetUndefined();
}
示例6: execute
void execute(const Arguments &args) {
EscapableHandleScope scope(args.GetIsolate());
REQUIRE_ARGS_LENGTH(4);
TxExecuteAndCloseCall * ncallptr = new TxExecuteAndCloseCall(args);
ncallptr->runAsync();
args.GetReturnValue().SetUndefined();
}
示例7: BatchImpl_freeImpl
void BatchImpl_freeImpl(const Arguments &args) {
BatchImpl * set = unwrapPointer<BatchImpl *>(args.Holder());
delete set;
set = 0;
wrapPointerInObject(set, BatchImplEnvelope, args.Holder());
args.GetReturnValue().SetUndefined();
}
示例8: scanNextResult
// int nextResult(buffer)
// IMMEDIATE
void scanNextResult(const Arguments & args) {
DEBUG_MARKER(UDEB_DETAIL);
EscapableHandleScope scope(args.GetIsolate());
typedef NativeMethodCall_1_<int, ScanOperation, char *> MCALL;
MCALL mcall(& ScanOperation::nextResult, args);
mcall.run();
args.GetReturnValue().Set(scope.Escape(mcall.jsReturnVal()));
}
示例9: destroy
/* Call destructor
*/
void destroy(const Arguments &args) {
DEBUG_MARKER(UDEB_DEBUG);
REQUIRE_ARGS_LENGTH(0);
AsyncNdbContext *c = unwrapPointer<AsyncNdbContext *>(args.Holder());
delete c;
args.GetReturnValue().SetUndefined();
}
示例10: Ndb_cluster_connection_delete_wrapper
void Ndb_cluster_connection_delete_wrapper(const Arguments &args) {
DEBUG_MARKER(UDEB_DETAIL);
EscapableHandleScope scope(args.GetIsolate());
typedef NativeDestructorCall<Ndb_cluster_connection> MCALL;
MCALL * mcallptr = new MCALL(args);
mcallptr->runAsync();
args.GetReturnValue().SetUndefined();
}
示例11: executeAsynch
/* IMMEDIATE.
*/
void executeAsynch(const Arguments &args) {
EscapableHandleScope scope(args.GetIsolate());
typedef NativeMethodCall_4_<int, BatchImpl,
int, int, int, Handle<Function> > MCALL;
MCALL mcall(& BatchImpl::executeAsynch, args);
mcall.run();
args.GetReturnValue().Set(mcall.jsReturnVal());
}
示例12: end
void end(const Arguments & args) {
DEBUG_MARKER(UDEB_DETAIL);
EscapableHandleScope scope(args.GetIsolate());
typedef NativeMethodCall_0_<int, NdbScanFilter> NCALL;
NCALL ncall(& NdbScanFilter::end, args);
ncall.run();
args.GetReturnValue().Set(scope.Escape(ncall.jsReturnVal()));
}
示例13: newScanOperation
// Constructor wrapper
void newScanOperation(const Arguments &args) {
EscapableHandleScope scope(args.GetIsolate());
ScanOperation * s = new ScanOperation(args);
Local<Value> wrapper = ScanOperationEnvelope.wrap(s);
// freeFromGC: Disabled as it leads to segfaults during garbage collection
// ScanOperationEnvelope.freeFromGC(helper, wrapper);
args.GetReturnValue().Set(scope.Escape(wrapper));
}
示例14: create_ndb
void create_ndb(const Arguments &args) {
REQUIRE_ARGS_LENGTH(3);
typedef NativeCFunctionCall_2_<Ndb *, Ndb_cluster_connection *, const char *> MCALL;
MCALL * mcallptr = new MCALL(& async_create_ndb, args);
mcallptr->wrapReturnValueAs(& NdbEnvelope);
mcallptr->runAsync();
args.GetReturnValue().SetUndefined();
}
示例15: querySetTransactionImpl
void querySetTransactionImpl(const Arguments &args) {
REQUIRE_ARGS_LENGTH(1);
typedef NativeVoidMethodCall_1_<QueryOperation, TransactionImpl *> MCALL;
MCALL mcall(& QueryOperation::setTransactionImpl, args);
mcall.run();
args.GetReturnValue().SetUndefined();
}