本文整理汇总了C++中Owned::buildDeclare方法的典型用法代码示例。如果您正苦于以下问题:C++ Owned::buildDeclare方法的具体用法?C++ Owned::buildDeclare怎么用?C++ Owned::buildDeclare使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Owned
的用法示例。
在下文中一共展示了Owned::buildDeclare方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: buildDeserialize
void CChildLimitedDatasetColumnInfo::buildDeserialize(HqlCppTranslator & translator, BuildCtx & ctx, IReferenceSelector * selector, IHqlExpression * helper, IAtom * serializeForm)
{
assertex(!column->isDictionary());
if (sizeField || !countField)
{
ctx.addQuoted("rtlFailUnexpected();");
return;
}
//NB: The serialized form of a dataset with an external count is not the same as a normal dataset
IHqlExpression * record = column->queryRecord();
if (recordRequiresSerialization(record, serializeForm) || !translator.isFixedRecordSize(record))
{
Owned<IHqlCppDatasetBuilder> builder = translator.createBlockedDatasetBuilder(column->queryRecord());
builder->buildDeclare(ctx);
buildDeserializeToBuilder(translator, ctx, builder, selector, helper, serializeForm);
CHqlBoundExpr bound;
builder->buildFinish(ctx, bound);
setColumnFromBuilder(translator, ctx, selector, builder);
}
else
CColumnInfo::buildDeserialize(translator, ctx, selector, helper, serializeForm);
}
示例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);
}
}