basic visual data pass-thru distributor

This commit is contained in:
Charles J. Cliffe 2015-07-27 22:05:35 -04:00
parent 090062191c
commit 0198f2410f

View File

@ -32,16 +32,18 @@ public:
void run() {
busy_update.lock();
process();
if (input && !input->empty()) {
process();
}
busy_update.unlock();
}
protected:
virtual void process() {
// process inputs to output
// distribute(output);
}
protected:
void distribute(ReferenceCounter *output) {
// distribute outputs
output->setRefCount(outputs.size());
@ -56,3 +58,17 @@ protected:
std::mutex busy_update;
};
class VisualDataDistributor : public VisualProcessor {
protected:
virtual void process() {
while (!input->empty()) {
ReferenceCounter *inp;
input->pop(inp);
if (inp) {
distribute(inp);
}
}
}
};