FougTools  0.7.0dev-046fb6a
Handy tools for C++, Qt and OpenCascade
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
runner_current_thread.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** FougTools
3 ** Copyright Fougue (30 Mar. 2015)
4 ** contact@fougue.pro
5 **
6 ** This software is a computer program whose purpose is to provide utility
7 ** tools for the C++ language and the Qt toolkit.
8 **
9 ** This software is governed by the CeCILL-C license under French law and
10 ** abiding by the rules of distribution of free software. You can use,
11 ** modify and/ or redistribute the software under the terms of the CeCILL-C
12 ** license as circulated by CEA, CNRS and INRIA at the following URL
13 ** "http://www.cecill.info".
14 ****************************************************************************/
15 
16 #pragma once
17 
18 #include "base_runner.h"
19 
20 namespace qttask {
21 
22 struct CurrentThread { };
23 
26 template<>
28 {
29 public:
31  : BaseRunner(mgr),
32  m_isAbortRequested(false)
33  { }
34 
35 protected:
36  bool isAbortRequested() override
37  { return m_isAbortRequested; }
38 
39  void requestAbort() override
40  { m_isAbortRequested = true; }
41 
42  void launch() override
43  { this->execRunnableFunc(); }
44 
45 private:
46  bool m_isAbortRequested;
47 };
48 
49 } // namespace qttask
Task runner executing in the current thread context.
Definition: runner_current_thread.h:27
Base class for all runner objects.
Definition: base_runner.h:31
BaseRunner(const Manager *mgr)
Definition: base_runner.cpp:22
Definition: base_runner.h:73
bool isAbortRequested() override
Definition: runner_current_thread.h:36
void requestAbort() override
Definition: runner_current_thread.h:39
void launch() override
Definition: runner_current_thread.h:42
Central class providing management of tasks and notifications.
Definition: manager.h:32
Definition: runner_current_thread.h:22
void execRunnableFunc()
Definition: base_runner.cpp:71
Definition: base_runner.cpp:20