25 TaskNode(std::function<
void()> func, std::string name =
"none",
bool isCritical =
false) :
26 m_name(name), m_isCritical(isCritical),
27 m_computeTime(0.0),
m_func(func),
36 m_name = other.m_name;
37 m_enabled = other.m_enabled;
38 m_isCritical = other.m_isCritical;
39 m_computeTime = other.m_computeTime;
40 m_enableTiming = other.m_enableTiming;
45 void operator=(
const TaskNode& other)
49 m_name = other.m_name;
50 m_enabled = other.m_enabled;
51 m_isCritical = other.m_isCritical;
52 m_computeTime = other.m_computeTime;
53 m_enableTiming = other.m_enableTiming;
60 void setFunction(std::function<
void()> func) { this->
m_func = func; }
61 void setEnabled(
bool enabled) { this->m_enabled = enabled; }
84 static size_t getUniqueID()
86 const size_t idx = s_numGlobalIds;
92 std::string m_name =
"none";
93 bool m_enabled =
true;
94 bool m_isCritical =
false;
95 double m_computeTime = 0.0;
96 bool m_enableTiming =
false;
99 std::function<void()>
m_func =
nullptr;
103 static std::atomic<size_t> s_numGlobalIds;
size_t getGlobalId() const
Get the global (unique) index of the geometry.
Base class for TaskGraph nodes.
bool isFunctional() const
Returns true if function is nullptr.
size_t m_globalId
Mutex lock for thread-safe counter update.
static size_t getNumGlobalIds()
Get number of ids/taskNodes.
std::function< void()> m_func
Don't allow user to call directly (must use execute)
virtual void execute()
Calls the function pointer provided if node enabled.