Skip to content

Commit

Permalink
don't access internals
Browse files Browse the repository at this point in the history
  • Loading branch information
lroberts36 committed Jun 10, 2024
1 parent eeeabaf commit 6090cac
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions src/tasks/tasks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,11 +423,15 @@ class TaskList {

inline friend std::ostream &operator<<(std::ostream &stream, const TaskList &tl) {
std::vector<std::shared_ptr<Task>> tasks;
tasks.insert(tasks.end(), tl.tasks.begin(), tl.tasks.end());
for (const auto &stl : tl.sublists) {
tl.AppendTasks(tasks);
return WriteTaskGraph(stream, tasks);
}

void AppendTasks(std::vector<std::shared_ptr<Task>> &tasks) const {
tasks.insert(tasks.end(), tasks.begin(), tasks.end());
for (const auto &stl : sublists) {
tasks.insert(tasks.end(), stl->tasks.begin(), stl->tasks.end());
}
return WriteTaskGraph(stream, tasks);
}

private:
Expand Down Expand Up @@ -553,10 +557,7 @@ class TaskRegion {
inline friend std::ostream &operator<<(std::ostream &stream, const TaskRegion &region) {
std::vector<std::shared_ptr<Task>> tasks;
for (const auto &tl : region.task_lists) {
tasks.insert(tasks.end(), tl.tasks.begin(), tl.tasks.end());
for (const auto &stl : tl.sublists) {
tasks.insert(tasks.end(), stl->tasks.begin(), stl->tasks.end());
}
tl.AppendTasks(tasks);
}
return WriteTaskGraph(stream, tasks);
}
Expand Down Expand Up @@ -625,14 +626,9 @@ class TaskCollection {

inline friend std::ostream &operator<<(std::ostream &stream, const TaskCollection &tc) {
std::vector<std::shared_ptr<Task>> tasks;
int iregion{0};
for (const auto &region : tc.regions) {
int itl{0};
for (const auto &tl : region.task_lists) {
tasks.insert(tasks.end(), tl.tasks.begin(), tl.tasks.end());
for (const auto &stl : tl.sublists) {
tasks.insert(tasks.end(), stl->tasks.begin(), stl->tasks.end());
}
tl.AppendTasks(tasks);
}
}
return WriteTaskGraph(stream, tasks);
Expand Down

0 comments on commit 6090cac

Please sign in to comment.