tex update lock, VisualData"Re"Distributor

This commit is contained in:
Charles J. Cliffe
2015-09-10 21:48:18 -04:00
parent 4301d0d434
commit 0a6d409065
5 changed files with 31 additions and 4 deletions
+22
View File
@@ -107,3 +107,25 @@ protected:
}
};
template<class OutputDataType = ReferenceCounter>
class VisualDataReDistributor : public VisualProcessor<OutputDataType, OutputDataType> {
protected:
void process() {
while (!VisualProcessor<OutputDataType, OutputDataType>::input->empty()) {
if (!VisualProcessor<OutputDataType, OutputDataType>::isAnyOutputEmpty()) {
return;
}
OutputDataType *inp;
VisualProcessor<OutputDataType, OutputDataType>::input->pop(inp);
if (inp) {
OutputDataType *outp = buffers.getBuffer();
(*outp) = (*inp);
inp->decRefCount();
VisualProcessor<OutputDataType, OutputDataType>::distribute(outp);
}
}
}
ReBuffer<OutputDataType> buffers;
};