本文整理汇总了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;
}
示例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();
}
}
示例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;
}
示例4: writeToDB
int Loadable::writeToDB(const QByteArray &pdata, const QString pkgname,
QString &errMsg, ParameterList ¶ms)
{
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)
{
//.........这里部分代码省略.........