See also: storage
class reference.
Model of
Description
The storage class can store the arguments it receives from a signal, as well as transmit the stored argument values through its own signal.
Example
// instantiate all of the components we need signals::storage<void ()> banger; signals::storage<void (float)> floater(2.5f); signals::storage<void (float)> collector(0.0f); // ---Connect the dataflow network ----------------------------- // // ,--------. void() // | banger | -------. // `--------' | // | // V // ,-(send_slot)-. void(float) ,-----------. // | floater | -------------> | collector | // `-------------' `-----------' // // ------------------------------------------------------------- banger >>= floater.send_slot(); floater >>= collector; // signal from banger is will invoke floater.send(), which causes // floater to output 2.5 banger(); BOOST_CHECK_EQUAL(floater.at<0>(), 2.5f); BOOST_CHECK_EQUAL(collector.at<0>(), 2.5f); floater.close(); floater(1.5f); // change the value in floater // we can also signal floater directly, which will again cause it to // output its stored value: invoke(floater); BOOST_CHECK_EQUAL(collector.at<0>(), 1.5f);