Last change
on this file since 2602 was 1053, checked in by casaldaliga, 23 years ago |
renamed files to conform MAGIC standard
|
File size:
482 bytes
|
Line | |
---|
1 | #ifndef PERIODICSIGNAL
|
---|
2 | #define PERIODICSIGNAL
|
---|
3 | //for signals
|
---|
4 | #include <sigc++/signal_system.h>
|
---|
5 | using namespace SigC;
|
---|
6 | //for threads
|
---|
7 | #include <pthread.h>
|
---|
8 |
|
---|
9 | class PeriodicSignal
|
---|
10 | {
|
---|
11 | private:
|
---|
12 | unsigned int period;//in usec
|
---|
13 | public:
|
---|
14 | Signal0<void> signal;
|
---|
15 |
|
---|
16 | PeriodicSignal(unsigned int period_);
|
---|
17 | void Start();
|
---|
18 | void Stop();
|
---|
19 |
|
---|
20 | private:
|
---|
21 | static void * SleepPeriodAndSignal( void* arg);
|
---|
22 | pthread_mutex_t mutex4stop;
|
---|
23 | bool stopped;
|
---|
24 | pthread_t thread;
|
---|
25 |
|
---|
26 | };
|
---|
27 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.