mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 05:05:19 -05:00
* sys: Initial refactoring of the SharedData class * sys/pattern: More refactoring, make every provider have its own patterns * sys: Finished up refactoring. No more SharedData! * sys: Fixed compile on Unix * tests: Fixed unit tests * sys: Moved view and lang files * pattern: Added assignment operator support to for loops * tests: Fixed compile issue
38 lines
850 B
C++
38 lines
850 B
C++
#pragma once
|
|
|
|
#include <hex.hpp>
|
|
|
|
#include <list>
|
|
#include <mutex>
|
|
#include <string>
|
|
|
|
namespace hex {
|
|
|
|
class Task {
|
|
public:
|
|
Task(const std::string &unlocalizedName, u64 maxValue);
|
|
~Task();
|
|
|
|
void setMaxValue(u64 maxValue);
|
|
void update(u64 currValue);
|
|
void finish();
|
|
|
|
[[nodiscard]] double getProgress() const;
|
|
|
|
[[nodiscard]] const std::string &getName() const;
|
|
|
|
[[nodiscard]] bool isPending() const;
|
|
|
|
static size_t getRunningTaskCount();
|
|
static std::list<Task *>& getRunningTasks() { return Task::s_runningTasks; }
|
|
static std::mutex& getTaskMutex() { return Task::s_taskMutex; }
|
|
|
|
private:
|
|
std::string m_name;
|
|
u64 m_maxValue, m_currValue;
|
|
|
|
static std::list<Task *> s_runningTasks;
|
|
static std::mutex s_taskMutex;
|
|
};
|
|
|
|
} |