// Example 10 — Static Hello Pipeline // // The same linear pipeline as example 01, built with make_network() instead // of the runtime Network builder. The topology is fully known at compile time: // cycle detection is a static_assert, no build() step is needed, and start/stop // require no virtual dispatch through a string-keyed node map. // // [produce] --int--> [double_it] --int--> [print_it] #include #include #include #include static int produce() { return 42; } static int double_it(int x) { return x * 2; } static void print_it(int x) { std::cout << "result: " << x << '\n'; } int main() { using namespace kpn; auto src = make_node(5); auto dbl = make_node(5); auto sink = make_node(5); auto net = make_network( edge(src.output<0>(), dbl.input<0>()), edge(dbl.output<0>(), sink.input<0>()) ); net.start(); std::this_thread::sleep_for(std::chrono::milliseconds(100)); net.stop(); }