This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
ffnamespace:tutorial [2015/09/08 14:54] torquati |
ffnamespace:tutorial [2015/09/08 14:58] torquati |
||
---|---|---|---|
Line 51: | Line 51: | ||
ff_Pipe<> pipe(make_unique<firstStage>(), | ff_Pipe<> pipe(make_unique<firstStage>(), | ||
make_unique<ff_node_F<fftask_t> >(secondStage), | make_unique<ff_node_F<fftask_t> >(secondStage), | ||
- | make_unique<thirdStage>()); | + | make_unique<thirdStage>() |
+ | ); | ||
if (pipe.run_and_wait_end()<0) error("running pipe"); | if (pipe.run_and_wait_end()<0) error("running pipe"); | ||
return 0; | return 0; | ||
Line 71: | Line 72: | ||
int main() { | int main() { | ||
- | std::vector<ff_node*> W = {new thirdStage, new thirdStage}; // the farm has 2 workers | + | std::vector<std::unique_ptr<ff_node> > W = { // the farm has 2 workers |
- | ff_pipe<fftask_t> pipe(new firstStage, secondStage, new ff_farm<>(W)); | + | make_unique<thirdStage>(), |
- | pipe.cleanup_nodes(); | + | make_unique<thirdStage>() |
+ | }; | ||
+ | ff_Pipe<> pipe(make_unique<firstStage>(), | ||
+ | make_unique<ff_node_F<fftask_t> >(secondStage), | ||
+ | make_unique<ff_Farm<fftask_f> >(std::move(W)) | ||
+ | ); | ||
if (pipe.run_and_wait_end()<0) error("running pipe"); | if (pipe.run_and_wait_end()<0) error("running pipe"); | ||
return 0; | return 0; |