//////////////////////
cg.setMappingSet(COPY_LEFT_MAPPING);
int vectorId = 0;
for (VectorWrapper<?> vw : left) {
JVar vvIn = cg.declareVectorValueSetupAndMember("incomingLeft",
new TypedFieldId(vw.getField().getType(), vectorId));
JVar vvOut = cg.declareVectorValueSetupAndMember("outgoing",
new TypedFieldId(vw.getField().getType(),vectorId));
// todo: check result of copyFromSafe and grow allocation
cg.getEvalBlock().add(vvOut.invoke("copyFromSafe")
.arg(COPY_LEFT_MAPPING.getValueReadIndex())
.arg(COPY_LEFT_MAPPING.getValueWriteIndex())
.arg(vvIn));
++vectorId;
}
cg.getEvalBlock()._return(JExpr.lit(true));
// generate copyRight()
///////////////////////
cg.setMappingSet(COPY_RIGHT_MAPPING);
int rightVectorBase = vectorId;
for (VectorWrapper<?> vw : right) {
JVar vvIn = cg.declareVectorValueSetupAndMember("incomingRight",
new TypedFieldId(vw.getField().getType(), vectorId - rightVectorBase));
JVar vvOut = cg.declareVectorValueSetupAndMember("outgoing",
new TypedFieldId(vw.getField().getType(),vectorId));
// todo: check result of copyFromSafe and grow allocation
cg.getEvalBlock().add(vvOut.invoke("copyFromSafe")
.arg(COPY_RIGHT_MAPPING.getValueReadIndex())
.arg(COPY_RIGHT_MAPPING.getValueWriteIndex())
.arg(vvIn));