mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-04-07 16:26:04 +00:00
begin rewrite: add lionkor/commandline
This commit is contained in:
committed by
Anonymous275
parent
6a2ce7faab
commit
e5e447c7af
16
include/IThreaded.h
Normal file
16
include/IThreaded.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include <thread>
|
||||
|
||||
// pure virtual class to be inherited from by classes which intend to be threaded
|
||||
class IThreaded {
|
||||
public:
|
||||
IThreaded()
|
||||
// invokes operator() on this object
|
||||
: _Thread(std::thread([this] { (*this)(); })) { }
|
||||
|
||||
virtual void operator()() = 0;
|
||||
|
||||
protected:
|
||||
std::thread _Thread;
|
||||
};
|
||||
Reference in New Issue
Block a user