22 lines
431 B
C++
22 lines
431 B
C++
#pragma once
|
|
#include <functional>
|
|
#include "extern.h"
|
|
|
|
class CORE_API thread_message {
|
|
public:
|
|
virtual ~thread_message() = default;
|
|
|
|
virtual void execute() = 0;
|
|
};
|
|
|
|
class CORE_API lamba_thread_message : public thread_message {
|
|
public:
|
|
lamba_thread_message(const std::function<void()>& in_func) : function(in_func) {
|
|
|
|
}
|
|
void execute() override {
|
|
function();
|
|
}
|
|
std::function<void()> function;
|
|
};
|