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


C++ do_call函数代码示例

本文整理汇总了C++中do_call函数的典型用法代码示例。如果您正苦于以下问题:C++ do_call函数的具体用法?C++ do_call怎么用?C++ do_call使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了do_call函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: PyWinObject_FromCWnd

BOOL CVirtualHelper::call(BOOL boolVal, CWnd *pWnd1, CWnd *pWnd2)
{
	if (!handler) return FALSE;
	CEnterLeavePython _celp;
	PyObject *wnd1;
	if (pWnd1) {
		wnd1 = PyWinObject_FromCWnd(pWnd1);
		if (!wnd1) return FALSE;
	} else {
		Py_INCREF(Py_None);
		wnd1 = Py_None;
	}
	PyObject *wnd2;
	if (pWnd2) {
		wnd2 = 	PyWinObject_FromCWnd(pWnd2);
		if (!wnd2) return FALSE;
	} else {
		Py_INCREF(Py_None);
		wnd2 = Py_None;
	}
	PyObject *arglst = Py_BuildValue("(iOO)",boolVal, wnd1, wnd2);
	BOOL ret = do_call(arglst);
	DODECREF (wnd1); // the reference I created.
	DODECREF (wnd2); // the reference I created.
	return ret;
}
开发者ID:DavidGuben,项目名称:rcbplayspokemon,代码行数:26,代码来源:win32virt.cpp

示例2: Py_BuildValue

BOOL CVirtualHelper::call(UINT_PTR val)
{
	if (!handler) return FALSE;
	CEnterLeavePython _celp;
	PyObject *arglst = Py_BuildValue("(N)",PyWinObject_FromULONG_PTR(val));
	return do_call(arglst);
}
开发者ID:DavidGuben,项目名称:rcbplayspokemon,代码行数:7,代码来源:win32virt.cpp

示例3: do_run_thread

static enum CoopthRet do_run_thread(struct coopth_t *thr,
	struct coopth_per_thread_t *pth)
{
    enum CoopthRet ret = do_call(pth);
    switch (ret) {
#define DO_SWITCH(x) \
    case COOPTH_##x: \
	pth->st = SW_ST(x); \
	break
#define DO_SWITCH2(x, c) \
    case COOPTH_##x: \
	c; \
	pth->st = SW_ST(x); \
	break
    DO_SWITCH(YIELD);
    DO_SWITCH(WAIT);
    DO_SWITCH(SCHED);
    DO_SWITCH(DETACH);
    DO_SWITCH(LEAVE);
    DO_SWITCH(DONE);
    DO_SWITCH2(ATTACH, coopth_callf_chk(thr, pth));

    case COOPTH_SLEEP:
	pth->st = ST(SLEEPING);
	break;
    case COOPTH_DELETE:
	do_del_thread(thr, pth);
	break;
    }
    return ret;
}
开发者ID:ccarcel,项目名称:dosemu2,代码行数:31,代码来源:coopth.c

示例4: do_call

/*
** Call a function (C or Lua). The parameters must be on the stack,
** between [stack+base,top). The function to be called is at stack+base-1.
** When returns, the results are on the stack, between [stack+base-1,top).
** The number of results is nResults, unless nResults=MULT_RET.
*/
static void do_call (StkId base, int nResults)
{
  StkId firstResult;
  TObject *func = stack+base-1;
  int i;
  if (ttype(func) == LUA_T_CFUNCTION) {
    ttype(func) = LUA_T_CMARK;
    firstResult = callC(fvalue(func), base);
  }
  else if (ttype(func) == LUA_T_FUNCTION) {
    ttype(func) = LUA_T_MARK;
    firstResult = lua_execute(func->value.tf->code, base);
  }
  else { /* func is not a function */
    /* Check the tag method for invalid functions */
    TObject *im = luaI_getimbyObj(func, IM_FUNCTION);
    if (ttype(im) == LUA_T_NIL)
      lua_error("call expression not a function");
    open_stack((top-stack)-(base-1));
    stack[base-1] = *im;
    do_call(base, nResults);
    return;
  }
  /* adjust the number of results */
  if (nResults != MULT_RET)
    adjust_top(firstResult+nResults);
  /* move results to base-1 (to erase parameters and function) */
  base--;
  nResults = top - (stack+firstResult);  /* actual number of results */
  for (i=0; i<nResults; i++)
    *(stack+base+i) = *(stack+firstResult+i);
  top -= firstResult-base;
}
开发者ID:Akagi201,项目名称:learning-lua,代码行数:39,代码来源:opcode.c

示例5: callFB

/*
** Call the specified fallback, putting it on the stack below its arguments
*/
static void callFB (int fb)
{
  int nParams = luaI_fallBacks[fb].nParams;
  open_stack(nParams);
  *(top-nParams-1) = luaI_fallBacks[fb].function;
  do_call((top-stack)-nParams, luaI_fallBacks[fb].nResults);
}
开发者ID:cskau,项目名称:VM,代码行数:10,代码来源:opcode.c

示例6: do_call

/*
** Call a function (C or Lua). The parameters must be on the stack,
** between [stack+base,top). The function to be called is at stack+base-1.
** When returns, the results are on the stack, between [stack+base-1,top).
** The number of results is nResults, unless nResults=MULT_RET.
*/
static void do_call (StkId base, int nResults)
{
  StkId firstResult;
  Object *func = stack+base-1;
  int i;
  if (tag(func) == LUA_T_CFUNCTION)
  {
    tag(func) = LUA_T_CMARK;
    firstResult = callC(fvalue(func), base);
  }
  else if (tag(func) == LUA_T_FUNCTION)
  {
    tag(func) = LUA_T_MARK;
    firstResult = lua_execute(func->value.tf->code, base);
  }
  else
  { /* func is not a function */
    /* Call the fallback for invalid functions */
    open_stack((top-stack)-(base-1));
    stack[base-1] = luaI_fallBacks[FB_FUNCTION].function;
    do_call(base, nResults);
    return;
  }
  /* adjust the number of results */
  if (nResults != MULT_RET && top - (stack+firstResult) != nResults)
    adjust_top(firstResult+nResults);
  /* move results to base-1 (to erase parameters and function) */
  base--;
  nResults = top - (stack+firstResult);  /* actual number of results */
  for (i=0; i<nResults; i++)
    *(stack+base+i) = *(stack+firstResult+i);
  top -= firstResult-base;
}
开发者ID:cskau,项目名称:VM,代码行数:39,代码来源:opcode.c

示例7: do_call_to

static void do_call_to(int cs, int ip, struct RealModeCallStructure *rmreg,
		       int rmask)
{
    do_call(READ_RMREG(cs, rmask), READ_RMREG(ip, rmask), rmreg, rmask);
    RMREG(cs) = cs;
    RMREG(ip) = ip;
}
开发者ID:andrewbird,项目名称:dosemu2,代码行数:7,代码来源:callbacks.c

示例8: do_unprotectedrun

static void do_unprotectedrun (lua_CFunction f, int nParams, int nResults)
{
  StkId base = (top-stack)-nParams;
  open_stack(nParams);
  stack[base].ttype = LUA_T_CFUNCTION;
  stack[base].value.f = f;
  do_call(base+1, nResults);
}
开发者ID:Akagi201,项目名称:learning-lua,代码行数:8,代码来源:opcode.c

示例9: do_callinc

/*
** Call the function at CLS_current.base, and incorporate results on
** the Lua2C structure.
*/
static void do_callinc (int nResults)
{
  StkId base = CLS_current.base;
  do_call(base+1, nResults);
  CLS_current.lua2C = base;  /* position of the new results */
  CLS_current.num = (top-stack) - base;  /* number of results */
  CLS_current.base = base + CLS_current.num;  /* incorporate results on stack */
}
开发者ID:Akagi201,项目名称:learning-lua,代码行数:12,代码来源:opcode.c

示例10: call

	void call(const MetaObject& mo) const
	{
		typename mirror::mp::is_a<
			MetaObject,
			typename tag_by_wrapper<Wrapper>::type
		>::type selector;
		do_call(mo, selector);
	}
开发者ID:Manokha,项目名称:firestarter,代码行数:8,代码来源:rubber.hpp

示例11: operator

 Boxed_Value operator()(const std::vector<Boxed_Value> &params, const chaiscript::Type_Conversions &t_conversions) const
 {
   if (m_arity < 0 || size_t(m_arity) == params.size()) {
     return do_call(params, t_conversions);
   } else {
     throw exception::arity_error(static_cast<int>(params.size()), m_arity);
   }
 }
开发者ID:mlamby,项目名称:ChaiScript,代码行数:8,代码来源:proxy_functions.hpp

示例12: do_call

void NvimRPC::call(const std::string &method, Integer& res, const U& ...u) {
    Object v = do_call(method, u...);
    std::cout << "Integer NvimRPC::call" << std::endl;
    
    // int64_t is only for negative integer.
    if(v.is_int64_t())       res = v.as_int64_t();
    else if(v.is_uint64_t()) res = v.as_uint64_t();
    else std::cout << "invalid response type" << std::endl; //TODO: add error handler
}
开发者ID:DaikiMaekawa,项目名称:neovim.cpp,代码行数:9,代码来源:nvim_rpc.hpp

示例13: parse_call

int parse_call()
{
    char *arg = strtok(NULL, " ");
    uint32_t addr;
    if(arg && parse_uint32(arg, &addr))
        return do_call(addr);
    else
        return syntax_error(arg);
}
开发者ID:CoreDumpling,项目名称:rockbox,代码行数:9,代码来源:hwemul_tool.c

示例14: do_call_indirect

VOID  do_call_indirect(ADDRINT target, BOOL taken)
{
    if( !taken ) return;

    const string *s = Target2String(target);
    do_call( s );
    
    if (s != &invalid)
        delete s;
}
开发者ID:alagenchev,项目名称:school_code,代码行数:10,代码来源:calltrace.cpp

示例15: operator

    void operator () (std::vector<boost::any> const& v)
    {
        if (v.size() < sizeof...(Args))
        {
            std::cout << "Bad arity!" << std::endl; // Throw if you prefer
            return;
        }

        return do_call(v, std::make_integer_sequence<int, sizeof...(Args)>());
    }
开发者ID:CCJY,项目名称:coliru,代码行数:10,代码来源:main.cpp


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