VOX
A little voxel engine
Loading...
Searching...
No Matches
tasks.hpp
Go to the documentation of this file.
1#pragma once
2
4#include <exception>
5#include "Executor.hpp"
6#include "Task.hpp"
7#include "TaskGraph.hpp"
8
9namespace task
10{
11
12
13class BaseError : public std::exception
14{
15public:
16 BaseError(const std::string & msg) : m_msg(msg) {}
17 virtual const char * what() const noexcept override { return m_msg.c_str(); }
18private:
19 std::string m_msg;
20};
21
23{
24public:
25 TaskNotFromSameGraphError() : BaseError("You tried to link tasks that are not from the same graph") {}
26};
27
28class CycleError : public BaseError
29{
30public:
31 CycleError() : BaseError("You tried to run a graph with a cycle in it") {}
32};
33
35{
36public:
37 EmptyGraphError() : BaseError("You tried to run an empty graph") {}
38};
39
41{
42public:
43 EmptyModuleError() : BaseError("You tried to run a graph containing an empty module/sub graph") {};
44 EmptyModuleError(const std::string & moduleName) : BaseError("You tried to run a graph containing an empty module/sub graph: " + moduleName) {}
45};
46} // namespace task
Definition: tasks.hpp:14
virtual const char * what() const noexcept override
Definition: tasks.hpp:17
BaseError(const std::string &msg)
Definition: tasks.hpp:16
Definition: tasks.hpp:29
CycleError()
Definition: tasks.hpp:31
Definition: tasks.hpp:35
EmptyGraphError()
Definition: tasks.hpp:37
Definition: tasks.hpp:41
EmptyModuleError(const std::string &moduleName)
Definition: tasks.hpp:44
EmptyModuleError()
Definition: tasks.hpp:43
Definition: tasks.hpp:23
TaskNotFromSameGraphError()
Definition: tasks.hpp:25
Definition: Executor.cpp:5