当前位置: 首页>>代码示例>>C++>>正文


C++ Arguments::GetReturnValue方法代码示例

本文整理汇总了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);
  }
}
开发者ID:plasmob,项目名称:mysql-js,代码行数:27,代码来源:QueryOperation_wrapper.cpp

示例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));
  }
}
开发者ID:alMysql,项目名称:mysql-js,代码行数:40,代码来源:DBOperationHelper.cpp

示例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));
}
开发者ID:plasmob,项目名称:mysql-js,代码行数:27,代码来源:QueryOperation_wrapper.cpp

示例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();
}
开发者ID:mysql,项目名称:mysql-js,代码行数:14,代码来源:DBDictionaryImpl.cpp

示例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();
}
开发者ID:mysql,项目名称:mysql-js,代码行数:7,代码来源:Ndb_wrapper.cpp

示例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();
}
开发者ID:alMysql,项目名称:mysql-js,代码行数:7,代码来源:BatchImpl_wrapper.cpp

示例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();
}
开发者ID:alMysql,项目名称:mysql-js,代码行数:7,代码来源:BatchImpl_wrapper.cpp

示例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()));
}
开发者ID:alMysql,项目名称:mysql-js,代码行数:10,代码来源:ScanOperation_wrapper.cpp

示例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();
}
开发者ID:alMysql,项目名称:mysql-js,代码行数:10,代码来源:AsyncNdbContext_wrapper.cpp

示例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();
}
开发者ID:mysql,项目名称:mysql-js,代码行数:8,代码来源:Ndb_cluster_connection_wrapper.cpp

示例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());
}
开发者ID:alMysql,项目名称:mysql-js,代码行数:10,代码来源:BatchImpl_wrapper.cpp

示例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()));
}
开发者ID:mysql,项目名称:mysql-js,代码行数:8,代码来源:NdbScanFilter_wrapper.cpp

示例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));
}
开发者ID:alMysql,项目名称:mysql-js,代码行数:9,代码来源:ScanOperation_wrapper.cpp

示例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();
}
开发者ID:mysql,项目名称:mysql-js,代码行数:9,代码来源:Ndb_wrapper.cpp

示例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();
}
开发者ID:plasmob,项目名称:mysql-js,代码行数:9,代码来源:QueryOperation_wrapper.cpp


注:本文中的Arguments::GetReturnValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。