8000 ff_visitor: implementing a walking strategy for a fastflow node by vincenzopalazzo · Pull Request #40 · fastflow/fastflow · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ff_visitor: implementing a walking strategy for a fastflow node #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vincenzopalazzo
Copy link

This is the first attempt to make a generic walk inside the fast flow node.

In addition, this is only a proof of concept, any feedbacks are welcome.

This is my small example to run the visitor over a node

template <typename T>
std::vector<T> ff_map(std::vector<T> &input, std::size_t core, std::size_t chunc) {
  ff::ParallelFor map(core);
  map.parallel_for(0L, input.size(), [&input](T const item){
    std::this_thread::sleep_for (std::chrono::milliseconds(1));
    //cpstl::cp_log(LOG, "Finish run...");
    std::court << "Finish run...\n";
  });

  ff::ff_str_visitor visit;
  map.accept(visit);
  std::court << "Fast flow patter" << visit.get_result() << "\n";
  return input;
}
  • Implementing Visitor pattern
  • Implementing the visit on the other ff node types

With this type of visitor, we could have the external plugin, that can custom implement visit on the fast flow node, one that I have in mind is to use json library to convert the ff pattern into a json file.

Signed-off-by: Vincenzo Palazzo vincenzopalazzodev@gmail.com

@vincenzopalazzo vincenzopalazzo changed the title ff_visitor: implementin a walking stragegy of a fastflow node ff_visitor: implementing a walking strategy for a fastflow node Jan 8, 2022
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
@vincenzopalazzo vincenzopalazzo force-pushed the vincenzopalazzo/walking branch from fcb743b to 6a72a68 Compare January 8, 2022 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0