mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-11-04 08:00:04 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			37 lines
		
	
	
	
		
			520 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			37 lines
		
	
	
	
		
			520 B
		
	
	
	
		
			C++
		
	
	
	
	
	
#pragma once
 | 
						|
 | 
						|
#include <memory>
 | 
						|
 | 
						|
#include <QObject>
 | 
						|
#include <QThread>
 | 
						|
 | 
						|
namespace scwx
 | 
						|
{
 | 
						|
namespace qt
 | 
						|
{
 | 
						|
namespace manager
 | 
						|
{
 | 
						|
 | 
						|
class ThreadManager : public QObject
 | 
						|
{
 | 
						|
   Q_OBJECT
 | 
						|
   Q_DISABLE_COPY_MOVE(ThreadManager)
 | 
						|
 | 
						|
public:
 | 
						|
   explicit ThreadManager();
 | 
						|
   ~ThreadManager();
 | 
						|
 | 
						|
   QThread* thread(const std::string& id, bool autoStart = true);
 | 
						|
 | 
						|
   void StopThreads();
 | 
						|
 | 
						|
   static ThreadManager& Instance();
 | 
						|
 | 
						|
private:
 | 
						|
   class Impl;
 | 
						|
   std::unique_ptr<Impl> p;
 | 
						|
};
 | 
						|
 | 
						|
} // namespace manager
 | 
						|
} // namespace qt
 | 
						|
} // namespace scwx
 |