-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAXEJobSystem.hpp
More file actions
37 lines (28 loc) · 1.02 KB
/
AXEJobSystem.hpp
File metadata and controls
37 lines (28 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef SHADOW_NATIVE_AXE_AXE_JOB_SYSTEM_HPP
#define SHADOW_NATIVE_AXE_AXE_JOB_SYSTEM_HPP
#include <ctime>
#include <functional>
#include <memory>
#include <string>
#include <vector>
namespace Shadow::AXE::JobSystem {
struct Job {
int id;
std::string name;
std::time_t startTime;
// Retired jobs only
bool success = false;
std::string miscInfo; // C++ exceptions usually go here
std::time_t endTime;
};
// Submit a job to be executed on a different thread
void submitJob(const std::string& name, std::function<bool()> jobMethod);
// Draws a small clickable widget to indicate the user of active jobs
void onUpdateStatusBar();
/// Artificially submit a faulty job with a specified message. You'd usually
/// want to do this when you handle an error yourself (hopefully without
/// crashing), but you want to indicate to the user via the toolbar that
/// AXE is degraded due to a handled error.
void degradeEditorWithMessage(const std::string& name, const std::string& message);
}
#endif /* SHADOW_NATIVE_AXE_AXE_JOB_SYSTEM_HPP */