MCPcopy Create free account
hub / github.com/Aegel5/SimpleSwitcher / WorkerInt

Method WorkerInt

src/CMainWorker.cpp:3–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1
2
3void CMainWorker::WorkerInt()
4{
5 IFW_LOG(SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL));
6
7 COM::CAutoCOMInitialize autoCom;
8 IFS_LOG(autoCom.Init());
9
10 WorkerImplement& workerImpl = *worker_impl.get();
11
12 bool exit = false;
13 while (!exit) {
14 auto msg = m_queue.GetMessageWait();
15 std::visit([&workerImpl, &exit](auto&& arg) {
16 using T = std::decay_t<decltype(arg)>;
17 if constexpr (std::is_same_v<T, Message_KeyType>) {
18 workerImpl.ProcessKeyMsg(arg);
19 }
20 else if constexpr (std::is_same_v<T, Message_Hotkey>) {
21 workerImpl.ProcessOurHotKey(std::move(arg));
22 }
23 else if constexpr (std::is_same_v<T, Message_ChangeForeg>) {
24 workerImpl.ChangeForeground(arg.hwnd);
25 }
26 else if constexpr (std::is_same_v<T, Message_ClearWorlds>) {
27 workerImpl.ClearAllWords();
28 }
29 else if constexpr (std::is_same_v<T, Message_Func>) {
30 arg(&workerImpl);
31 }
32 else if constexpr (std::is_same_v<T, Message_Quit>) {
33 exit = true;
34 }
35 }, msg);
36 }
37
38 LOG_ANY(L"Exit main worker");
39}
40
41void CMainWorker::Init() {
42 worker_impl = MAKE_UNIQUE(worker_impl);

Callers

nothing calls this directly

Calls 7

GetMessageWaitMethod · 0.80
ProcessKeyMsgMethod · 0.80
ProcessOurHotKeyMethod · 0.80
ChangeForegroundMethod · 0.80
ClearAllWordsMethod · 0.80
InitMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected