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


C++ ParameterList::at方法代码示例

本文整理汇总了C++中ParameterList::at方法的典型用法代码示例。如果您正苦于以下问题:C++ ParameterList::at方法的具体用法?C++ ParameterList::at怎么用?C++ ParameterList::at使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ParameterList的用法示例。


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

示例1:

bool
sp::AreFunctionTypesEqual(FunctionType *a, FunctionType *b)
{
  FunctionSignature *af = a->signature();
  FunctionSignature *bf = b->signature();
  if (!AreTypesEquivalent(af->returnType().resolved(),
                          bf->returnType().resolved(),
                          Qualifiers::None))
  {
    return false;
  }

  ParameterList *ap = af->parameters();
  ParameterList *bp = bf->parameters();
  if (ap->length() != bp->length())
    return false;

  for (size_t i = 0; i < ap->length(); i++) {
    VarDecl *arga = ap->at(i);
    VarDecl *argb = bp->at(i);
    if (!AreTypesEquivalent(arga->te().resolved(),
                            argb->te().resolved(),
                            Qualifiers::None))
    {
      return false;
    }
  }
  return true;
}
开发者ID:collinsmith,项目名称:sourcepawn,代码行数:29,代码来源:types.cpp

示例2: getParameters

/* Action 1: StartBattle */
void EventInterpreter::action1(Event *e) {
	ParameterList *params = getParameters(e);

	if(params->at(0)->isInteger() && !e->isLocked() && params->at(1)->isBoolean()) {
		Troop *troop = ResourceHelper::getTroop(*(int*)(params->at(0)->value()));
		gk::ApplicationStateStack::getInstance().push<BattleState>(troop, *(bool*)(params->at(1)->value()));

		e->lock();
	}
	else {
		e->currentActionID(*(int*)params->at(2 + EventListener::lastBattleResult())->value());

		e->unlock();
	}
}
开发者ID:Quent42340,项目名称:Asylia,代码行数:16,代码来源:EventInterpreter.cpp

示例3: costDrive

double costDrive(const ParameterList & parameterList, predicateCallbackType predicateCallback, numericalFluentCallbackType numericalFluentCallback, int relaxed)
{
   ROS_DEBUG("Calling %s module", __func__);

   string from = parameterList.at(0).value;
   string to = parameterList.at(1).value;

   //cout << "driving from " << from << " to " << to << endl;

   if(from == "l1") {
      if(to == "l1") {
         return 1.0;
      } else if(to == "l2") {
         return 10.0;
      } else if(to == "l3") {
         return 42.0;
      }
   } else if(from == "l2") {
      if(to == "l1") {
         return 10.0;
      } else if(to == "l2") {
         return 1.0;
      } else if(to == "l3") {
         return 10.0;
      }
   } else if(from == "l3") {
      if(to == "l1") {
         return 42.0;
      } else if(to == "l2") {
         return 10.0;
      } else if(to == "l3") {
         return 1.0;
      }
   }

   return 1.0;
}
开发者ID:GKIFreiburg,项目名称:gki_symbolic_planning,代码行数:37,代码来源:testModule.cpp

示例4: writeToDB

int Loadable::writeToDB(const QByteArray &pdata, const QString pkgname,
                        QString &errMsg, ParameterList &params)
{
  params.append("name",   _name);
  params.append("type",   _pkgitemtype);
  params.append("source", QString(pdata));
  params.append("notes",  _comment);

  // alter the name of the loadable's table if necessary
  QString destschema = "public";
  QString prefix;
  if (_schema.isEmpty()        &&   pkgname.isEmpty())
    ;   // leave it alone
  else if (_schema.isEmpty()   && ! pkgname.isEmpty())
  {
    prefix = "pkg";
    destschema = pkgname;
  }
  else if ("public" == _schema &&   pkgname.isEmpty())
    ;   // leave it alone
  else if ("public" == _schema && ! pkgname.isEmpty())
    prefix = "public.";
  else if (! _schema.isEmpty())
  {
    prefix = _schema + ".pkg";
    destschema = _schema;
  }

  if (! prefix.isEmpty())
  {
    params.append("pkgname", destschema);

    // yuck - no Parameter::operator==(Parameter&) and no replace()
    QString tablename = params.value("tablename").toString();
    for (int i = 0; i < params.size(); i++)
    {
      if (params.at(i).name() == "tablename")
      {
        params.takeAt(i);
        params.append("tablename", prefix + tablename);
        break;
      }
    }
  }

  if (_minMql && _minMql->isValid() && _grade == INT_MIN)
  {
    XSqlQuery minOrder = _minMql->toQuery(params);
    if (minOrder.first())
      _grade = minOrder.value(0).toInt();
    else if (minOrder.lastError().type() != QSqlError::NoError)
    {
      QSqlError err = minOrder.lastError();
      errMsg = _sqlerrtxt.arg(_filename).arg(err.driverText()).arg(err.databaseText());
      return -3;
    }
    else
      _grade = 0;
  }
  else if (_maxMql && _maxMql->isValid() && _grade == INT_MAX)
  {
    XSqlQuery maxOrder = _maxMql->toQuery(params);
    if (maxOrder.first())
      _grade = maxOrder.value(0).toInt();
    else if (maxOrder.lastError().type() != QSqlError::NoError)
    {
      QSqlError err = maxOrder.lastError();
      errMsg = _sqlerrtxt.arg(_filename).arg(err.driverText()).arg(err.databaseText());
      return -4;
    }
    else
      _grade = 0;
  }

  params.append("grade", _grade);

  XSqlQuery select;
  int itemid = -1;
  select = _selectMql->toQuery(params);

  if (select.first())
    itemid = select.value(0).toInt();
  else if (select.lastError().type() != QSqlError::NoError)
  {
    QSqlError err = select.lastError();
    errMsg = _sqlerrtxt.arg(_filename).arg(err.driverText()).arg(err.databaseText());
    return -5;
  }
  params.append("id", itemid);

  XSqlQuery upsert;
  if (itemid >= 0)
    upsert = _updateMql->toQuery(params);
  else
    upsert = _insertMql->toQuery(params);

  if (upsert.first())
    itemid = upsert.value("id").toInt();
  else if (upsert.lastError().type() != QSqlError::NoError)
  {
//.........这里部分代码省略.........
开发者ID:gilmoskowitz,项目名称:updater,代码行数:101,代码来源:loadable.cpp


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