本文整理汇总了C++中OwnedHqlExpr::getOperator方法的典型用法代码示例。如果您正苦于以下问题:C++ OwnedHqlExpr::getOperator方法的具体用法?C++ OwnedHqlExpr::getOperator怎么用?C++ OwnedHqlExpr::getOperator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OwnedHqlExpr
的用法示例。
在下文中一共展示了OwnedHqlExpr::getOperator方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeAttribute
virtual IHqlExpression * createTransformed(IHqlExpression * expr)
{
OwnedHqlExpr transformed = NewHqlTransformer::createTransformed(expr);
if (transformed->getOperator() == no_getgraphresult)
{
if (hasOperand(transformed, graph))
return removeAttribute(transformed, externalAtom);
}
return transformed.getClear();
}
示例2: switch
IHqlExpression * PositionTransformer::createTransformed(IHqlExpression * _expr)
{
OwnedHqlExpr transformed = NewHqlTransformer::createTransformed(_expr);
switch (transformed->getOperator())
{
case no_table:
{
IHqlExpression * mode = transformed->queryChild(2);
HqlExprArray fields;
HqlExprArray args;
if (mode->getOperator() == no_thor)
{
unwindChildren(fields, transformed->queryChild(1));
IHqlExpression * filePosAttr = createComma(createAttribute(virtualAtom, createAttribute(filepositionAtom)), insertedAttr.getLink());
IHqlExpression * sizeofAttr = createComma(createAttribute(virtualAtom, createAttribute(sizeofAtom)), insertedAttr.getLink());
fields.append(*createField(fileposName, makeIntType(8, false), NULL, filePosAttr));
fields.append(*createField(recordlenName, makeIntType(2, false), NULL, sizeofAttr));
unwindChildren(args, transformed);
args.replace(*createRecord(fields), 1);
return transformed->clone(args);
}
}
break;
case no_iterate:
case no_hqlproject:
{
HqlExprArray args;
HqlExprArray assigns;
IHqlExpression * transform = transformed->queryChild(1);
unwindChildren(args, transformed);
unwindChildren(assigns, transform);
IHqlExpression * inRecord = transformed->queryChild(0)->queryRecord();
IHqlExpression * outRecord = transform->queryRecord();
HqlExprArray fields;
unwindChildren(fields, outRecord);
ForEachChild(idx, inRecord)
{
IHqlExpression * child = inRecord->queryChild(idx);
if (child->hasProperty(insertedAtom))
{
IHqlExpression * newTarget = createField(child->queryName(), child->getType(), LINK(child), insertedAttr.getLink());
fields.append(*newTarget);
assigns.append(*createValue(no_assign, makeVoidType(), newTarget, createSelectExpr(createValue(no_left), LINK(newTarget))));
}
}
IHqlExpression * newRecord = createRecord(fields);
args.replace(*createValue(no_transform, newRecord->getType(), assigns), 1);
return transformed->clone(args);
}
break;
case no_join:
//only ok if join first
case no_rollup:
case no_newaggregate:
case no_aggregate:
fail();
break;
case no_usertable:
case no_selectfields:
{
IHqlExpression * grouping = transformed->queryChild(2);
if (grouping && (grouping->getOperator() != no_attr))
fail();
IHqlExpression * record = transformed->queryRecord();
HqlExprArray fields;
unwindChildren(fields, transformed->queryChild(1));
ForEachChild(idx, record)
{
IHqlExpression * child = record->queryChild(idx);
if (child->hasProperty(insertedAtom))
fields.append(*createField(child->queryName(), child->getType(), LINK(child), insertedAttr.getLink()));
}
HqlExprArray args;
unwindChildren(args, transformed);
args.replace(*createRecord(fields), 1);
return transformed->clone(args);
}
示例3: setColumn
void CChildSetColumnInfo::setColumn(HqlCppTranslator & translator, BuildCtx & ctx, IReferenceSelector * selector, IHqlExpression * _value)
{
OwnedHqlExpr address = getColumnAddress(translator, ctx, selector, boolType, 0);
OwnedHqlExpr addressSize = getColumnAddress(translator, ctx, selector, sizetType, sizeof(bool));
OwnedHqlExpr addressData = getColumnAddress(translator, ctx, selector, queryType(), sizeof(bool)+sizeof(size32_t));
OwnedHqlExpr isAllTarget = convertAddressToValue(address, boolType);
OwnedHqlExpr lengthTarget = convertAddressToValue(addressSize, sizetType);
ITypeInfo * columnType = column->queryType();
ITypeInfo * elementType = columnType->queryChildType();
OwnedHqlExpr value = ensureExprType(_value, columnType);
OwnedHqlExpr inlineSize;
switch (value->getOperator())
{
case no_list:
if ((value->numChildren() != 0) && ::isFixedSize(elementType))
inlineSize.setown(getSizetConstant(value->numChildren() * elementType->getSize()));
break;
}
if (inlineSize)
{
checkAssignOk(translator, ctx, selector, inlineSize, sizeof(size32_t)+sizeof(bool));
Owned<IHqlCppSetBuilder> builder = translator.createInlineSetBuilder(elementType, isAllTarget, inlineSize, addressData);
builder->buildDeclare(ctx);
translator.buildSetAssign(ctx, builder, value);
CHqlBoundTarget boundTarget;
boundTarget.length.set(lengthTarget);
builder->buildFinish(ctx, boundTarget);
}
else
{
CHqlBoundExpr bound;
if ((value->getOperator() == no_list) && value->numChildren())
{
CHqlBoundTarget tempTarget;
translator.createTempFor(ctx, columnType, tempTarget, typemod_none, FormatNatural);
translator.buildExprAssign(ctx, tempTarget, value);
bound.setFromTarget(tempTarget);
}
else
translator.buildExpr(ctx, value, bound);
ensureSimpleLength(translator, ctx, bound);
OwnedHqlExpr isAll = bound.getIsAll();
OwnedHqlExpr length = translator.getBoundLength(bound);
OwnedHqlExpr size = createValue(no_translated, LINK(sizetType), translator.getBoundSize(bound));
checkAssignOk(translator, ctx, selector, size, sizeof(size32_t)+sizeof(bool));
translator.assignBoundToTemp(ctx, isAllTarget, isAll);
translator.assignBoundToTemp(ctx, lengthTarget, length);
translator.buildBlockCopy(ctx, addressData, bound);
ensureSimpleLength(translator, ctx, bound);
OwnedHqlExpr boundSize = translator.getBoundSize(bound);
associateSizeOf(ctx, selector, boundSize, sizeof(size32_t)+sizeof(bool));
}
}