• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setVar函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: _getVar

static inline Int
_getVar(Equation e, Var var, va_list args) /* Var, Int, Var, Int, ... */
{ int argc, i;
  Var vars[FWD_PCE_MAX_ARGS];
  Any vals[FWD_PCE_MAX_ARGS];
  Any savd[FWD_PCE_MAX_ARGS];
  numeric_value v;

  for(argc = 0; (vars[argc] = va_arg(args, Var)) != NULL; argc++)
  { assert(argc <= FWD_PCE_MAX_ARGS);
    assert(instanceOfObject(vars[argc], ClassVar));

    vals[argc] = va_arg(args, Expression);
    assert(vals[argc] != NULL);
  }

  for(i=0; i<argc; i++)
  { savd[i] = vars[i]->value;
    setVar(vars[i], vals[i]);
  }

  evaluateEquation(e, var, &v);

  for(i=0; i<argc; i++)
    setVar(vars[i], savd[i]);

  return ar_int_result(e, &v);
}
开发者ID:SWI-Prolog,项目名称:packages-xpce,代码行数:28,代码来源:spatial.c


示例2: put_new_attvar

static void
put_new_attvar(Word p, atom_t name, Word value ARG_LD)
{ Word gp, at;

  assert(gTop+6 <= gMax && tTop+1 <= tMax);

  gp = gTop;
  if ( p >= (Word)lBase )
  { gTop += 6;
    at = &gp[1];
    setVar(*at);
    gp[0] = consPtr(&gp[1], TAG_ATTVAR|STG_GLOBAL);
    *p = makeRefG(&gp[0]);
    LTrail(p);
  } else
  { gTop += 5;
    at = &gp[0];
    setVar(*at);
    *p = consPtr(&gp[0], TAG_ATTVAR|STG_GLOBAL);
    GTrail(p);
  }

  at[1] = FUNCTOR_att3;
  at[2] = name;
  at[3] = linkVal(value);
  at[4] = ATOM_nil;
  at[0] = consPtr(&at[1], TAG_COMPOUND|STG_GLOBAL);
}
开发者ID:brayc0,项目名称:nlfetdb,代码行数:28,代码来源:pl-attvar.c


示例3: exitCyclicCopy

static inline void
exitCyclicCopy(int flags ARG_LD)
{ Word p;

  while(popSegStack(&LD->cycle.lstack, &p, Word))
  { if ( isRef(*p) )
    { Word p2 = unRef(*p);

      if ( *p2 == VAR_MARK )		/* sharing variables */
      { setVar(*p2);
	setVar(*p);
      } else
      { *p = *p2 | MARK_MASK;		/* cyclic terms */
      }
    } else
    { Word old;

      popSegStack(&LD->cycle.lstack, &old, Word);

      if ( !(flags&COPY_ATTRS) )
      { Word p2 = valPAttVar(*p & ~BOTH_MASK);

	assert(*p2 == VAR_MARK);
	setVar(*p2);
      }

      *p = consPtr(old, STG_GLOBAL|TAG_ATTVAR);
    }
  }
}
开发者ID:DouglasRMiles,项目名称:swipl-devel,代码行数:30,代码来源:pl-copyterm.c


示例4: snprintf

bool agi::hangup(int cause) 
{
	char cause_str[16];
	snprintf(cause_str,sizeof(cause_str),"%i",cause);
	setVar("PRI_CAUSE",cause_str);
	return (exec("HANGUP")==1);
}
开发者ID:olivecoder,项目名称:cppagi,代码行数:7,代码来源:cppagi.cpp


示例5: lookup

//------------------------------------------------------------------------------
int lookup(int *typeOfObject)
{
  int i;
  gettoken(yytext, sizeof yytext);

  if (!strnicmp(yytext,"reg",3) && strlen(yytext) == 5 && isdigit(yytext[3]) && isdigit(yytext[4]) && (i=atoi(yytext+3))>=0 && i<100)
  {
    *typeOfObject=IDENTIFIER;
    return i+EVAL_MAX_VARS;
  }

  for (i=0;i<EVAL_MAX_VARS;i++)
    if (!strnicmp(varTable[i].name, yytext,sizeof(varTable[i].name)))
    {
      *typeOfObject = IDENTIFIER;
      return i;
    }

  for (i=0;getFunctionFromTable(i);i++)
  {
    functionType *f=getFunctionFromTable(i);
    if (!strcmpi(f->name, yytext))
    {
      *typeOfObject = objectId(f->nParams);
      return i;
    }
  }
  *typeOfObject = IDENTIFIER;
  setLastVar();
  i = setVar(-1, 0);
  return i;
}
开发者ID:chezinut,项目名称:vis_avs,代码行数:33,代码来源:eval.c


示例6: newTerm

Word
newTerm(void)
{ GET_LD
  Word t = allocGlobal(1);

  setVar(*t);

  return t;
}
开发者ID:brayc0,项目名称:nlfetdb,代码行数:9,代码来源:pl-alloc.c


示例7: getDirection

void AgiEngine::motionMoveObj(ScreenObjEntry *screenObj) {
	screenObj->direction = getDirection(screenObj->xPos, screenObj->yPos, screenObj->move_x, screenObj->move_y, screenObj->stepSize);

	// Update V6 if ego
	if (isEgoView(screenObj))
		setVar(VM_VAR_EGO_DIRECTION, screenObj->direction);

	if (screenObj->direction == 0)
		motionMoveObjStop(screenObj);
}
开发者ID:AReim1982,项目名称:scummvm,代码行数:10,代码来源:motion.cpp


示例8: setVar

ParzenMachine::ParzenMachine(int n_inputs_,int n_outputs_,real var_)
{
  data = NULL;
  setVar(var_);
  n_outputs = n_outputs_;
  n_inputs = n_inputs_;
  outputs = new(allocator) Sequence(1,n_outputs);
  n_real_examples = 0;
  real_examples = NULL;
}
开发者ID:Dandelion0124,项目名称:smartalbum,代码行数:10,代码来源:ParzenMachine.cpp


示例9: setVarFunc

int setVarFunc(HSQUIRRELVM v) {
  StackHandler sa(v);
  if (sa.GetType(1) == OT_TABLE) {
    VarRefPtr vr;
    int res = getVarInfo(sa,vr);
    if (res != SQ_OK) return res;
    return setVar(sa,vr,vr->offsetOrAddrOrConst);
  } // if
  return SQ_ERROR;
} // setVarFunc
开发者ID:Hiroyuki-Nagata,项目名称:mona,代码行数:10,代码来源:SqPlus.cpp


示例10: setVarFunc

int setVarFunc(HSQUIRRELVM v) {
  SquirrelVM::Init(v);  // For handling multi-VM setting right
  StackHandler sa(v);
  if (sa.GetType(1) == OT_TABLE) {
    VarRefPtr vr;
    int res = getVarInfo(sa,vr);
    if (res != SQ_OK) return res;
    return setVar(sa,vr,vr->offsetOrAddrOrConst);
  } // if
  return SQ_ERROR;
} // setVarFunc
开发者ID:hamstah,项目名称:geogen,代码行数:11,代码来源:SqPlus.cpp


示例11: setInstanceVarFunc

int setInstanceVarFunc(HSQUIRRELVM v) {
  StackHandler sa(v);
  if (sa.GetType(1) == OT_INSTANCE) {
    VarRefPtr vr;
    void * data;
    int res = getInstanceVarInfo(sa,vr,data);
    if (res != SQ_OK) return res;
    return setVar(sa,vr,data);
  } // if
  return SQ_ERROR;
} // setInstanceVarFunc
开发者ID:Hiroyuki-Nagata,项目名称:mona,代码行数:11,代码来源:SqPlus.cpp


示例12: setInstanceVarFunc

int setInstanceVarFunc(HSQUIRRELVM v) {
  SquirrelVM::Init(v);  // For handling multi-VM setting right
  StackHandler sa(v);
  if (sa.GetType(1) == OT_INSTANCE) {
    VarRefPtr vr;
    void * data;
    int res = getInstanceVarInfo(sa,vr,data);
    if (res != SQ_OK) return res;
    return setVar(sa,vr,data);
  } // if
  return SQ_ERROR;
} // setInstanceVarFunc
开发者ID:hamstah,项目名称:geogen,代码行数:12,代码来源:SqPlus.cpp


示例13: setVar_i

void
setVar_i (varPrec * time,
	  char *type, int *s2, char *cont, int *s1, varPrec * val, int *err)
{
  char *t = (char *) malloc (sizeof (char) * (*s2 + 1));
  char *c = (char *) malloc (sizeof (char) * (*s1 + 1));
  memcpy (t, type, *s2);
  t[*s2] = '\0';
  memcpy (c, cont, *s1);
  c[*s1] = '\0';
  *err = setVar (*time, t, c, *val);
}
开发者ID:sisarolo,项目名称:Generic-Trace-Generator,代码行数:12,代码来源:interfaceCFortranBasic1.c


示例14: int

/* 如果显示调用
typedef int (*lpFetchData)();
typedef int (*lpSaveVar)();
typedef LPCSTR (*lpGetVar)(const LPCSTR group, const LPCSTR key);
typedef int(*lpShowVar)();
typedef int(*lpTest_save)();
......
HINSTANCE hDll = LoadLibrary("fKeyValue.dll");//导入.dll动态连接库
lpFetchData fetchData=(lpFetchData)GetProcAddress(hDll,"fetchData");
lpShowVar showVar=(lpShowVar)GetProcAddress(hDll,"showVar");
lpGetVar getVar=(lpGetVar)GetProcAddress(hDll,"getVar");
......
dosomething....
FreeLibrary(hDll);
*/
int main(void)
{
    setFile("D:\\users\\goosy\\codes\\GoosyFBase\\data.ini");
    //test_save();
    fetchData();
    showVar();
    setVar("Date","safeDays","7845");
    saveVar();
    printf("安全天数为%s", getVar("Date","safeDays"));
    //MessageBoxA(0, getVar("Date","safeDays"), "安全天数为", MB_OK | MB_ICONINFORMATION);
    getch();
    return 0;
}
开发者ID:goosy,项目名称:GoosyFBase,代码行数:28,代码来源:testClient.c


示例15: _mode

Func::Func(const Func& rhs): _mode(rhs._mode)
{
    _varbuf.reserve(VARMAX);
    _parser.SetVarFactory(_addVar, this);
    // Adding pi and e, the defaults are `_pi` and `_e`
    _parser.DefineConst(_T("pi"), (mu::value_type)M_PI);
    _parser.DefineConst(_T("e"), (mu::value_type)M_E);
    setExpr(rhs.getExpr());
    vector <string> vars = rhs.getVars();
    for (unsigned int ii = 0; ii < vars.size(); ++ii){
        setVar(vars[ii], rhs.getVar(vars[ii]));
    }
}
开发者ID:iampritishpatil,项目名称:moose,代码行数:13,代码来源:Func.cpp


示例16: _clearBuffer

Func& Func::operator=(const Func rhs)
{
    _clearBuffer();
    _mode = rhs._mode;
    // Adding pi and e, the defaults are `_pi` and `_e`
    _parser.DefineConst(_T("pi"), (mu::value_type)M_PI);
    _parser.DefineConst(_T("e"), (mu::value_type)M_E);
    setExpr(rhs.getExpr());
    vector <string> vars = rhs.getVars();
    for (unsigned int ii = 0; ii < vars.size(); ++ii){
        setVar(vars[ii], rhs.getVar(vars[ii]));
    }
    return *this;
}
开发者ID:iampritishpatil,项目名称:moose,代码行数:14,代码来源:Func.cpp


示例17: setError

void cParser::onSpace(void)
{
    std::string name;
    if (!m_variable.empty() && !m_curVariable.empty())//两个都不为空
    {
        if(m_varLine == m_curLine)
        {
            setError(2);//同一行上出现两个变量
            return ;
        }
        else//不同行上的两个变量
        {//忽略上一行无用的变量
            setVar(m_curVariable);
            m_curVariable.clear();
        }
    }
    else if( m_variable.empty() && !m_curVariable.empty())
    {
        setVar(m_curVariable);
        m_curVariable.clear();
    }
    skipSpace();
}
开发者ID:Guojiayuhanhan,项目名称:online-judger,代码行数:23,代码来源:lzdParser.cpp


示例18: setFlag

void AgiEngine::motionMoveObjStop(ScreenObjEntry *screenObj) {
	screenObj->stepSize = screenObj->move_stepSize;

	// This check for motionType was only done in AGI3.
	// But we use this motion type for mouse movement, so we need to check in any case, otherwise it will cause glitches.
	if (screenObj->motionType != kMotionEgo) {
		setFlag(screenObj->move_flag, true);
	}

	screenObj->motionType = kMotionNormal;
	if (isEgoView(screenObj)) {
		_game.playerControl = true;
		setVar(VM_VAR_EGO_DIRECTION, 0);
	}
}
开发者ID:AReim1982,项目名称:scummvm,代码行数:15,代码来源:motion.cpp


示例19: setVar

void AgiEngine::motionWander(ScreenObjEntry *screenObj) {
	uint8 originalWanderCount = screenObj->wander_count;

	screenObj->wander_count--;
	if ((originalWanderCount == 0) || (screenObj->flags & fDidntMove)) {
		screenObj->direction = _rnd->getRandomNumber(8);

		if (isEgoView(screenObj)) {
			setVar(VM_VAR_EGO_DIRECTION, screenObj->direction);
		}

		while (screenObj->wander_count < 6) {
			screenObj->wander_count = _rnd->getRandomNumber(50);    // huh?
		}
	}
}
开发者ID:AReim1982,项目名称:scummvm,代码行数:16,代码来源:motion.cpp


示例20: parseVarName

void cParser::onReturn(void)
{
    std::string name = parseVarName();
    m_curVariable.clear();
    m_variable.clear();
    if (error())
    {
        setError(0);
        ++m_curLine;
        return;
    }
    else
    {
        setVar(name);
        ++m_curLine;
    }
}
开发者ID:Guojiayuhanhan,项目名称:online-judger,代码行数:17,代码来源:lzdParser.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setVelocity函数代码示例发布时间:2022-05-30
下一篇:
C++ setValidator函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap