4 Sep 09:06
[dataflow][review] facilities for creating generic components
From: Stjepan Rajko <stipe <at> asu.edu>
Subject: [dataflow][review] facilities for creating generic components
Newsgroups: gmane.comp.lib.boost.devel
Date: 2008-09-04 07:08:12 GMT
Subject: [dataflow][review] facilities for creating generic components
Newsgroups: gmane.comp.lib.boost.devel
Date: 2008-09-04 07:08:12 GMT
Hello, I updated the Dataflow documentation with some examples showing how to create generic (in the sense that they can be used with a number of signal signatures) components for Dataflow.Signals with the help of some provided class templates. These class templates are applicator, conditional, instantiator, and modifier (there is also a conditional_modifier which is not documented, but it basically provides functionality of both conditional and modifier). The updated docs (with examples) are uploaded to: http://www.dancinghacker.com/code/dataflow/ You will find the mentioned class templates in the Components subsection of the Dataflow.Signals section. For example, the modifier documentation shows how to easily build a generic multiplier component, which will multiply each argument of the passing signal by a specified factor. The component could then be used as follows: { signals::storage<void (int, double)> result; multiplier<void (int, double)> multiply_by_3 (3); // result will store the result of the multiplication multiply_by_3 >>= result; multiply_by_3(1, 1.5); BOOST_ASSERT(result.at<0>() == 3);(Continue reading)
RSS Feed