28 TaskNode(std::shared_ptr<TaskGraph> graph, std::function<
void()>
task)
32 TaskNode(std::shared_ptr<TaskGraph> host_graph, std::shared_ptr<TaskGraph> composed_graph)
33 : m_type(
type::
GRAPH), m_data(GraphData{composed_graph}){};
42 m_dependents.push_back(&node);
45 m_sucessors.push_back(&node);
48 m_dependents.erase(std::remove(m_dependents.begin(), m_dependents.end(), &node), m_dependents.end());
51 m_sucessors.erase(std::remove(m_sucessors.begin(), m_sucessors.end(), &node), m_sucessors.end());
54 void setName(
const std::string & name) { m_name = name; }
55 std::string
getName()
const {
return m_name; }
58 std::shared_ptr<TaskGraph>
getGraph()
const {
return std::get<GraphData>(m_data).graph; }
66 std::function<void()> m_task;
72 std::shared_ptr<TaskGraph> graph;
75 std::vector<TaskNode *> m_dependents;
76 std::vector<TaskNode *> m_sucessors;
78 std::variant<NodeData, GraphData> m_data;
Definition: Executor.hpp:21
Definition: TaskGraph.hpp:22
TaskNode(std::shared_ptr< TaskGraph > host_graph, std::shared_ptr< TaskGraph > composed_graph)
Definition: Node.hpp:32
std::vector< TaskNode * > & getSucessors()
Definition: Node.hpp:61
std::string getName() const
Definition: Node.hpp:55
std::vector< TaskNode * > & getDependents()
Definition: Node.hpp:60
TaskNode(std::shared_ptr< TaskGraph > graph, std::function< void()> task)
Definition: Node.hpp:28
void addSuccessor(TaskNode &node)
Definition: Node.hpp:44
std::shared_ptr< TaskGraph > getGraph() const
Definition: Node.hpp:58
TaskNode & operator=(TaskNode &&)=delete
TaskNode & operator=(const TaskNode &)=delete
void addDependent(TaskNode &node)
Definition: Node.hpp:41
void removeSucessor(TaskNode &node)
Definition: Node.hpp:50
void setName(const std::string &name)
Definition: Node.hpp:54
type
Definition: Node.hpp:22
TaskNode(const TaskNode &)=delete
~TaskNode()
Definition: Node.hpp:35
void removeDependent(TaskNode &node)
Definition: Node.hpp:47
type getType() const
Definition: Node.hpp:57
TaskNode(TaskNode &&)=delete
Definition: Executor.cpp:5