Skip to content

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

Open
vincenzopalazzo wants to merge 1 commit into
fastflow:masterfrom
vincenzopalazzo:vincenzopalazzo/walking
Open

ff_visitor: implementing a walking strategy for a fastflow node#40
vincenzopalazzo wants to merge 1 commit into
fastflow:masterfrom
vincenzopalazzo:vincenzopalazzo/walking

Conversation

@vincenzopalazzo

Copy link
Copy Markdown

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