本文整理汇总了C++中NodeValue::id方法的典型用法代码示例。如果您正苦于以下问题:C++ NodeValue::id方法的具体用法?C++ NodeValue::id怎么用?C++ NodeValue::id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NodeValue
的用法示例。
在下文中一共展示了NodeValue::id方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: typesUsed
IlwisTypes OperationNodeScript::typesUsed(int index, const NodeValue& vright, SymbolTable &symbols) const {
if ( index >= vright.size())
return itUNKNOWN;
IlwisTypes tp1 = symbols.ilwisType(vright[index], vright.id(index));
IlwisTypes tp2 = symbols.ilwisType(_value[index], _value.id(index));
if ( tp1 == itUNKNOWN || tp2 == itUNKNOWN)
return itUNKNOWN;
return tp1 | tp2;
}
示例2: getName
QString TermNode::getName(const NodeValue& var) const {
QString name = var.toString();
if (name != sUNDEF)
return name;
// QString typeName = var.typeName();
// if ( typeName == "Ilwis::IRasterCoverage") {
// Ilwis::IRasterCoverage raster = var.value<Ilwis::IRasterCoverage>();
// name = raster->name();
// }
// if ( typeName == "Coordinate") {
// name = var.id();
// }
// if ( typeName == "Voxel") {
// name = var.id();
// }
return var.id();
}
示例3: evaluate
bool AssignmentNode::evaluate(SymbolTable& symbols, int scope, ExecutionContext *ctx)
{
if ( _expression.isNull())
return false;
try{
bool ok = _expression->evaluate(symbols, scope, ctx);
if ( ok) {
// we save the additional info as we might need it but for the rest clear
// the results as the result of the assignment node is a newly filled ctx
auto additionalInfo = ctx->_additionalInfo;
ctx->clear(true);
NodeValue val = _expression->value();
for(int i = 0; i < val.size(); ++i) {
Symbol sym = symbols.getSymbol(val.id(i),SymbolTable::gaREMOVEIFANON);
IlwisTypes tp = sym.isValid() ? sym._type : itUNKNOWN;
QString result = _outParms->id(i);
if ( hasType(tp, itILWISOBJECT | itCOLUMN)) {
if ( hasType(tp, itRASTER)) {
ok &= copyObject<RasterCoverage>(sym, result,symbols);
}
else if (hasType(tp, itFEATURE))
ok &= copyObject<FeatureCoverage>(sym, result,symbols);
else if (hasType(tp, itCOORDSYSTEM))
ok &= copyObject<CoordinateSystem>(sym, result,symbols);
else if ( hasType(tp, itDOMAIN)){
ok &= copyObject<Domain>(sym, result,symbols);
} else if ( hasType(tp, itGEOREF)){
ok &= copyObject<GeoReference>(sym, result,symbols);
} else if (hasType(tp, itTABLE | itCOLUMN)){
ok &= copyObject<Table>(sym, result,symbols,true);
QSharedPointer<Selector> selector = _outParms->selector(result);
if (!selector.isNull()){
QString varName = selector->variable();
ITable source = sym._var.value<ITable>();
QString oldColName = additionalInfo[source->name()].toString();
QVariant newT= symbols.getValue(result);
ITable newTable = newT.value<ITable>();
ColumnDefinition& coldef = newTable->columndefinitionRef(oldColName);
if ( coldef.isValid()){
coldef.name(varName);
}
}
}
if(!ok) {
throw ErrorObject(QString(TR(ERR_OPERATION_FAILID1).arg("assignment")));
}
QSharedPointer<ASTNode> specifier = _outParms->specifier(_outParms->id(i));
if ( !specifier.isNull()) {
if ( specifier->noOfChilderen()!= 1)
return ERROR2(ERR_NO_OBJECT_TYPE_FOR_2, "Output object", "expression");
store2Format(specifier, sym, result);
}
ctx->_results.push_back(result);
} else {
sym = symbols.getSymbol(result,SymbolTable::gaREMOVEIFANON);
tp = sym.isValid() ? sym._type : itUNKNOWN;
if ( tp == itUNKNOWN) {
tp = Domain::ilwType(val);
}
}
//ctx->addOutput(symbols,_expression->value(),result, tp, Resource());
}
}
return ok;
} catch(const ErrorObject&){
}
return false;
}