GridComputing
Job Management in Grid Computing
Main Page
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
runnable.h
Go to the documentation of this file.
1
#ifndef RUNNABLE_H_
2
#define RUNNABLE_H_
3
4
#include <atomic>
5
#include <thread>
6
8
11
class
Runnable
12
{
13
public
:
14
Runnable
() :
_stop
(),
_thread
() { }
15
virtual
~Runnable
() {
Stop
(); }
16
17
void
Stop
() {
_stop
=
true
;
_thread
.join(); }
18
void
Start
() {
_thread
= std::thread(&
Runnable::Run
,
this
); }
19
20
protected
:
21
virtual
void
Run
() = 0;
22
std::atomic<bool>
_stop
;
23
24
private
:
25
std::thread
_thread
;
26
27
private
:
// no copying
28
Runnable
(
Runnable
const
&);
29
Runnable
&
operator =
(
Runnable
const
&);
30
};
31
32
#endif // RUNNABLE_H_
src
runnable.h
Generated on Sun Dec 30 2012 14:13:37 for GridComputing by
1.8.2