Subversion Repositories HomeAutomation

Rev

Rev 1317 | Details | Compare with Previous | Last modification | View Log | SVN | RSS feed

Rev Author Line No. Line
1309 runge 1
/*
2
 * Thread.h
3
 *
4
 *  Created on: Apr 26, 2009
5
 *      Author: Mattias Runge
6
 */
7
 
8
#ifndef THREAD_H_
9
#define THREAD_H_
10
 
11
#include <boost/thread.hpp>
12
 
13
namespace atom {
1317 runge 14
namespace thread {
1309 runge 15
 
16
class Thread
17
{
18
public:
19
    Thread();
20
    virtual ~Thread();
21
 
1403 runge 22
    void Start();
23
    void Stop();
24
    boost::thread::id GetId();
25
    bool IsRunning();
1309 runge 26
 
27
protected:
1403 runge 28
    virtual void Run() = 0;
1309 runge 29
 
30
private:
1403 runge 31
    boost::thread thread_;
32
    bool is_running_;
1309 runge 33
 
1403 runge 34
    void RunBase();
1309 runge 35
};
36
 
1403 runge 37
} // namespace thread
38
} // namespace atom
1309 runge 39
 
40
#endif /* THREAD_H_ */