public static class EvaluationVisitor.VectorVariableHolder extends ClassGenerator.HoldingContainer
TODO: This is not especially elegant. But the code that declares the
holder/reader does not know about the parameter(s) that will use it,
and the normal HoldingContainer
can hold only one variable,
not a broader context. This version holds more context. Perhaps this
idea should be generalized.
Constructor and Description |
---|
VectorVariableHolder(ClassGenerator.HoldingContainer base,
ClassGenerator<?> classGen,
com.sun.codemodel.JBlock vvSetupBlock,
com.sun.codemodel.JExpression vectorExpr,
com.sun.codemodel.JExpression recordIndex) |
Modifier and Type | Method and Description |
---|---|
com.sun.codemodel.JVar |
generateUnionReader()
Specialized hack for the UNION type to obtain a
FieldReader
directly from the value vector, bypassing the UnionHolder
created from that vector. |
f, getHolder, getIsSet, getMajorType, getMinorType, getValue, isConstant, isOptional, isReader, isRepeated, isSingularRepeated, setConstant, toString
public VectorVariableHolder(ClassGenerator.HoldingContainer base, ClassGenerator<?> classGen, com.sun.codemodel.JBlock vvSetupBlock, com.sun.codemodel.JExpression vectorExpr, com.sun.codemodel.JExpression recordIndex)
public com.sun.codemodel.JVar generateUnionReader()
FieldReader
directly from the value vector, bypassing the UnionHolder
created from that vector. Handles setting the reader position only once
in an eval block rather than on each reference. There may be multiple
functions that need the reader. To ensure we create only one common
reader, we "go back in time" to add the reader at the point after
we declared the UnionHolder
.Copyright © 1970 The Apache Software Foundation. All rights reserved.