本文整理汇总了C++中OwnedHqlExpr::queryType方法的典型用法代码示例。如果您正苦于以下问题:C++ OwnedHqlExpr::queryType方法的具体用法?C++ OwnedHqlExpr::queryType怎么用?C++ OwnedHqlExpr::queryType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OwnedHqlExpr
的用法示例。
在下文中一共展示了OwnedHqlExpr::queryType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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));
}
}
}
}
示例2: setColumn
void CChildDatasetColumnInfo::setColumn(HqlCppTranslator & translator, BuildCtx & ctx, IReferenceSelector * selector, IHqlExpression * _value)
{
OwnedHqlExpr addressSize = getColumnAddress(translator, ctx, selector, sizetType, 0);
OwnedHqlExpr addressData = getColumnAddress(translator, ctx, selector, queryType(), sizeof(size32_t));
OwnedHqlExpr lengthTarget = convertAddressToValue(addressSize, sizetType);
ITypeInfo * columnType = column->queryType();
OwnedHqlExpr value = LINK(_value); //ensureExprType(_value, columnType);
ITypeInfo * valueType = value->queryType();
assertRecordTypesMatch(valueType, columnType);
bool assignInline = false; // canEvaluateInline(value); // MORE: What is the test
// bool assignInline = canAssignInline(&ctx, value) && !canEvaluateInline(&ctx, value);
value.setown(addDatasetLimits(translator, ctx, selector, value));
IHqlExpression * record = column->queryRecord();
if (assignInline)
{
OwnedHqlExpr inlineSize = getSizetConstant(0);
checkAssignOk(translator, ctx, selector, inlineSize, sizeof(size32_t));
//Can only assign inline if we know the maximum length that will be assigned is 0.
Owned<IHqlCppDatasetBuilder> builder = translator.createInlineDatasetBuilder(record, inlineSize, addressData);
builder->buildDeclare(ctx);
translator.buildDatasetAssign(ctx, builder, value);
CHqlBoundTarget boundTarget;
boundTarget.length.set(lengthTarget);
builder->buildFinish(ctx, boundTarget);
}
else
{
CHqlBoundExpr bound;
translator.buildDataset(ctx, value, bound, FormatBlockedDataset);
translator.normalizeBoundExpr(ctx, bound);
ensureSimpleLength(translator, ctx, bound);
OwnedHqlExpr length = translator.getBoundLength(bound);
OwnedHqlExpr size = createValue(no_translated, LINK(sizetType), translator.getBoundSize(bound));
checkAssignOk(translator, ctx, selector, size, sizeof(size32_t));
translator.assignBoundToTemp(ctx, lengthTarget, length);
translator.buildBlockCopy(ctx, addressData, bound);
//Use the size just calculated for the field
OwnedHqlExpr sizeOfExpr = createValue(no_sizeof, LINK(sizetType), LINK(selector->queryExpr()));
OwnedHqlExpr boundSize = translator.getBoundSize(bound);
OwnedHqlExpr srcSize = adjustValue(boundSize, sizeof(size32_t));
ctx.associateExpr(sizeOfExpr, srcSize);
}
}
示例3: processAbstractDataset
IHqlExpression* HqlGram::processAbstractDataset(IHqlExpression* _expr, IHqlExpression* formal, IHqlExpression* actual, IHqlExpression * mapping, const attribute& errpos, bool errorIfNotFound, bool & hadError)
{
LinkedHqlExpr transformed = _expr;
IHqlExpression* formalRecord = formal->queryRecord();
IHqlExpression* actualRecord = actual->queryRecord();
assertex(formalRecord && actualRecord);
hadError = false;
IHqlSimpleScope *actualScope = actualRecord->querySimpleScope();
unsigned numChildren = formalRecord->numChildren();
for (unsigned idx = 0; idx < numChildren; idx++)
{
IHqlExpression* kid = formalRecord->queryChild(idx);
if ((kid->getOperator() == no_ifblock) || kid->isAttribute())
continue;
IIdAtom * name = kid->queryId();
IIdAtom * mapto = fieldMapTo(mapping, name);
OwnedHqlExpr match = actualScope->lookupSymbol(mapto);
if (match)
{
if (!kid->queryType()->assignableFrom(match->queryType()))
{
StringBuffer fromType, toType;
getFriendlyTypeStr(kid,fromType);
getFriendlyTypeStr(match,toType);
reportError(ERR_DSPARAM_TYPEMISMATCH, errpos, "Can not mapping type %s(field '%s') to %s(field '%s')",
fromType.str(), str(kid->queryName()), toType.str(), str(match->queryName()));
hadError = true;
}
//MORE: This should really be mapped in a single go
if (transformed)
transformed.setown(bindField(transformed, kid, match));
}
else if (errorIfNotFound)
{
reportError(ERR_DSPARM_MISSINGFIELD,errpos,"Dataset %s has no field named '%s'", str(actual->queryName()), str(mapto));
hadError = true;
}
}
return transformed.getClear();
}