本文整理汇总了C++中OwnedHqlExpr::numChildren方法的典型用法代码示例。如果您正苦于以下问题:C++ OwnedHqlExpr::numChildren方法的具体用法?C++ OwnedHqlExpr::numChildren怎么用?C++ OwnedHqlExpr::numChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OwnedHqlExpr
的用法示例。
在下文中一共展示了OwnedHqlExpr::numChildren方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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));
}
}