Zeljko Vrba
David Abrahams wrote: | | like this one. If you can condense it into a simple statement, I'm | willing to try again, but otherwise I'm not sure I can help you. | Think UNIX pipelines: ls -l | sort | gzip > /tmp/blah
1 stage == one operation over the data. ls is provider fo sort which is provider to gzip.
i want to mimick the same in C++. each stage consumes data until its provider has some, does some processing on the data and feeds the result to its consumer (but only when its consumer asks it to provide the data - the model is consumer-driven).
but I need more powerful semantic: each stage can have more than one input, it can feed its output to more than one stage and types on input and output may differ.
is it a bit clearer now?
Seems like you want to build a dataflow machine at compile-time. It's a nontrivial problem because, among other things -- since you may have multiple consumers for any piece of data -- you have to buffer results. There aren't any simple answers, AFAICT. If you have a specific question, I can try to answer, but solving the whole design problem is beyond my capacity in my "free" time. -- Dave Abrahams Boost Consulting www.boost-consulting.com