本文整理汇总了C++中HqlExprArray::item方法的典型用法代码示例。如果您正苦于以下问题:C++ HqlExprArray::item方法的具体用法?C++ HqlExprArray::item怎么用?C++ HqlExprArray::item使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HqlExprArray
的用法示例。
在下文中一共展示了HqlExprArray::item方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ForEachItemIn
ForEachItemIn(i2, expandedOrder)
{
IHqlExpression * cur = &expandedOrder.item(i2);
if (explicitStepped)
{
if (!extractCondition(stepArgs, cur))
{
StringBuffer s;
if (cur->getOperator() == no_select)
s.append(cur->queryChild(1)->queryName());
else
getExprECL(cur, s);
throwError1(HQLERR_SteppingNotMatchSortCondition, s.str());
}
if (stepArgs.ordinality() == 0)
break;
}
else
{
if (!extractCondition(args, cur))
break;
foundStepped = true;
}
if (compareLhs)
break;
}
示例2: extractOutputs
void HqlCppLibrary::extractOutputs()
{
HqlExprArray symbols;
scopeExpr->queryScope()->getSymbols(symbols);
IHqlScope * scope = scopeExpr->queryScope();
HqlDummyLookupContext dummyctx(NULL);
ForEachItemIn(i, symbols)
{
IHqlExpression & cur = symbols.item(i);
if (isExported(&cur))
{
_ATOM name = cur.queryName();
OwnedHqlExpr value = scope->lookupSymbol(name, LSFpublic, dummyctx);
if (value && !value->isFunction())
{
if (value->isDataset() || value->isDatarow() || value->queryType()->isScalar())
{
OwnedHqlExpr null = createNullExpr(value);
outputs.append(*cur.cloneAllAnnotations(null));
}
}
}
}
示例3: getNumUniqueExpressions
unsigned getNumUniqueExpressions(const HqlExprArray & exprs)
{
TransformMutexBlock block;
ExpressionStatsInfo info;
ForEachItemIn(i, exprs)
calcNumUniqueExpressions(&exprs.item(i),info);
return info.count;
}
示例4: createLogicalGraph
void LogicalGraphCreator::createLogicalGraph(HqlExprArray & exprs)
{
graph.setown(createPTree("graph"));
// beginSubGraph(NULL, false);
ForEachItemIn(i, exprs)
createRootGraphActivity(&exprs.item(i));
// endSubGraph();
wu->createGraph("Logical", NULL, GraphTypeEcl, graph.getClear(), 0);
}
示例5: checkConsistent
void ScopeConsistencyChecker::checkConsistent(IHqlExpression * root, const HqlExprArray & _activeTables)
{
ForEachItemIn(i, _activeTables)
activeTables.append(OLINK(_activeTables.item(i)));
if (root->isDataset())
pushScope();
analyse(root, 0);
if (root->isDataset())
popScope();
}
示例6: getRootScopes
static void getRootScopes(HqlScopeArray & rootScopes, IHqlScope * scope)
{
HqlExprArray rootSymbols;
scope->getSymbols(rootSymbols);
ForEachItemIn(i, rootSymbols)
{
IHqlExpression & cur = rootSymbols.item(i);
IHqlScope * scope = cur.queryScope();
if (scope)
rootScopes.append(*LINK(scope));
}
示例7: createLogicalGraph
void LogicalGraphCreator::createLogicalGraph(HqlExprArray & exprs)
{
graph.setown(createPTree("graph"));
// beginSubGraph(NULL, false);
ForEachItemIn(i, exprs)
createRootGraphActivity(&exprs.item(i));
// endSubGraph();
Owned<IWUGraph> wug = wu->updateGraph("Logical");
wug->setXGMMLTree(graph.getClear());
wug->setType(GraphTypeEcl);
}
示例8: checkTemplateFunctionParameters
bool HqlGram::checkTemplateFunctionParameters(IHqlExpression* func, HqlExprArray& actuals, const attribute& errpos)
{
bool anyErrors = false;
IHqlExpression * formals = func->queryChild(1);
ForEachItemIn(idx, actuals)
{
IHqlExpression* formal = formals->queryChild(idx);
if (isAbstractDataset(formal))
{
IHqlExpression * actual = &actuals.item(idx);
IHqlExpression* mapping = queryFieldMap(actual);
bool hadError = false;
OwnedHqlExpr ignore = processAbstractDataset(NULL, formal, actual, mapping, errpos, true, hadError);
if (hadError)
anyErrors = true;
}
}
示例9: reportAbstractModule
void reportAbstractModule(IErrorReceiver & errors, IHqlExpression * expr, const ECLlocation & errpos)
{
IHqlScope * scope = expr->queryScope();
StringBuffer fieldText;
if (scope)
{
HqlExprArray symbols;
scope->getSymbols(symbols);
symbols.sort(compareSymbolsByName);
ForEachItemIn(i, symbols)
{
IHqlExpression & cur = symbols.item(i);
if (isPureVirtual(&cur))
{
if (fieldText.length())
fieldText.append(",");
fieldText.append(cur.queryName());
}
}
}
示例10: addPlugins
void ViewTransformerRegistry::addPlugins(const char * name)
{
loadedPlugins.setown(new SafePluginMap(&pluginCtx, true));
loadedPlugins->loadFromList(name);
Owned<IErrorReceiver> errorReporter = createThrowingErrorReceiver();
dataServer.setown(createNewSourceFileEclRepository(errorReporter, name, ESFallowplugins, 0));
HqlScopeArray scopes;
HqlParseContext parseCtx(dataServer, NULL, NULL);
HqlLookupContext ctx(parseCtx, errorReporter);
getRootScopes(scopes, dataServer, ctx);
ForEachItemIn(i, scopes)
{
IHqlScope * scope = &scopes.item(i);
HqlExprArray symbols;
try
{
scope->ensureSymbolsDefined(ctx);
scope->getSymbols(symbols);
ForEachItemIn(j, symbols)
{
IHqlExpression & cur = symbols.item(j);
if (cur.getOperator() == no_service)
addServiceDefinition(&cur);
}
}
catch (IException * e)
{
const char * name = str(scope->queryName());
VStringBuffer msg("Error loading plugin %s", name);
EXCLOG(e, msg.str());
}
}
示例11: addPairs
void HqlCppCaseInfo::addPairs(HqlExprArray & _pairs)
{
pairs.ensure(_pairs.ordinality());
ForEachItemIn(idx, _pairs)
addPair(&_pairs.item(idx));
}
示例12: queryActiveTableSelector
IHqlExpression * HqlCppCaseInfo::buildIndexedMap(BuildCtx & ctx, const CHqlBoundExpr & test)
{
ITypeInfo * compareType = test.queryType()->queryPromotedType();
type_t compareTypeCode = compareType->getTypeCode();
HqlExprArray values;
IHqlExpression * dft = queryActiveTableSelector(); // value doesn't matter as long as it will not occur
__int64 lower = getIntValue(lowerTableBound, 0);
unsigned num = (getIntValue(upperTableBound, 0)-lower)+1;
CHqlBoundExpr indexExpr;
switch (compareTypeCode)
{
case type_int:
indexExpr.set(test);
break;
case type_string:
indexExpr.expr.setown(createValue(no_index, makeCharType(), LINK(test.expr), getZero()));
indexExpr.expr.setown(createValue(no_cast, makeIntType(1, false), LINK(indexExpr.expr)));
break;
default:
throwUnexpectedType(compareType);
}
if (useRangeIndex && (num != 1))
translator.ensureSimpleExpr(ctx, indexExpr);
OwnedHqlExpr mapped;
ITypeInfo * retType = resultType;
//if num == pairs.ordinality() and all results are identical, avoid the table lookup.
if (allResultsMatch && (num == pairs.ordinality()))
{
mapped.set(pairs.item(0).queryChild(1));
}
else
{
values.ensure(num);
unsigned idx;
for (idx = 0; idx < num; idx++)
values.append(*LINK(dft));
ForEachItemIn(idx2, pairs)
{
IHqlExpression & cur = pairs.item(idx2);
IValue * value = cur.queryChild(0)->queryValue();
unsigned replaceIndex;
switch (compareTypeCode)
{
case type_int:
replaceIndex = (unsigned)(value->getIntValue()-lower);
break;
case type_string:
{
StringBuffer temp;
value->getStringValue(temp);
replaceIndex = (unsigned)((unsigned char)temp.charAt(0)-lower);
break;
}
default:
throwUnexpectedType(compareType);
}
IHqlExpression * mapTo = cur.queryChild(1);
if (mapTo->getOperator() != no_constant)
throwUnexpected();
if (replaceIndex >= num)
translator.reportWarning(CategoryIgnored, HQLWRN_CaseCanNeverMatch, "CASE entry %d can never match the test condition", replaceIndex);
else
values.replace(*LINK(mapTo),replaceIndex);
}
//Now replace the placeholders with the default values.
for (idx = 0; idx < num; idx++)
{
if (&values.item(idx) == dft)
values.replace(*defaultValue.getLink(),idx);
}
// use a var string type to get better C++ generated...
ITypeInfo * storeType = getArrayElementType(resultType);
ITypeInfo * listType = makeArrayType(storeType, values.ordinality());
OwnedHqlExpr lvalues = createValue(no_list, listType, values);
CHqlBoundExpr boundTable;
translator.buildExpr(ctx, lvalues, boundTable);
LinkedHqlExpr tableIndex = indexExpr.expr;
if (getIntValue(lowerTableBound, 0))
tableIndex.setown(createValue(no_sub, tableIndex->getType(), LINK(tableIndex), LINK(lowerTableBound)));
IHqlExpression * ret = createValue(no_index, LINK(retType), LINK(boundTable.expr), LINK(tableIndex));
mapped.setown(createTranslatedOwned(ret));
}