Subversion Repositories HomeAutomation

Rev

Rev 1026 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 1026 Rev 1042
Line 27... Line 27...
27
#include <string>
27
#include <string>
28
#include <time.h>
28
#include <time.h>
29
 
29
 
30
#include "../Threads/thread.h"
30
#include "../Threads/thread.h"
31
#include "../Tools/tools.h"
31
#include "../Tools/tools.h"
-
 
32
#include "../Threads/mutex.h"
32
 
33
 
33
class IntervalThread : public Thread<IntervalThread>
34
class IntervalThread : public Thread<IntervalThread>
34
{
35
{
35
public:
36
public:
36
    IntervalThread() { Thread<IntervalThread>(); };
37
    IntervalThread() { Thread<IntervalThread>(); };
37
    IntervalThread(unsigned int timeout);
38
    IntervalThread(unsigned int timeout);
38
    ~IntervalThread() { stop(); };
39
    ~IntervalThread() { stop(); };
39
 
40
 
40
    unsigned int getId() { return myId; };
41
    unsigned int getId() { return myId; };
-
 
42
 
-
 
43
    unsigned int getTimeout();
-
 
44
    void setTimeout(unsigned int timeout);
41
 
45
 
42
    void run();
46
    void run();
43
 
47
 
44
private:
48
private:
45
    unsigned int myId;
49
    unsigned int myId;
46
    unsigned int myTimeout;
50
    unsigned int myTimeout;
-
 
51
 
-
 
52
    bool myReset;
-
 
53
    Mutex myResetMutex;
-
 
54
 
-
 
55
    static unsigned int myCount;
-
 
56
    static Mutex myCountMutex;
47
};
57
};
48
 
58
 
49
#endif  /* _INTERVALTHREAD_H */
59
#endif  /* _INTERVALTHREAD_H */
50
 
60