-
Notifications
You must be signed in to change notification settings - Fork 29
/
TMan.cpp
48 lines (34 loc) · 1.14 KB
/
TMan.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "TMan.h"
using namespace std;
TMan::TMan(boost::shared_ptr<Sensors> _sensors,
boost::shared_ptr<Transcriber> _transcriber,
boost::shared_ptr<ThreadedImageTranscriber> _imageTranscriber,
boost::shared_ptr<MotionEnactor> _enactor,
boost::shared_ptr<Synchro> synchro,
boost::shared_ptr<Lights> _lights)
:Man(_sensors,_transcriber,_imageTranscriber,_enactor,synchro,_lights),
threadedImageTranscriber(_imageTranscriber)
{
}
TMan::~TMan(){
}
void TMan::startSubThreads(){
Man::startSubThreads();
// Start Image transcriber thread (it handles its own threading
if (threadedImageTranscriber->start() != 0) {
cerr << "Image transcriber failed to start" << endl;
}
else
threadedImageTranscriber->getTrigger()->await_on();
}
void TMan::stopSubThreads(){
#ifdef DEBUG_MAN_THREADING
cout << " TMan stoping:" << endl;
#endif
threadedImageTranscriber->stop();
threadedImageTranscriber->getTrigger()->await_off();
#ifdef DEBUG_MAN_THREADING
cout << " Image Transcriber thread is stopped" << endl;
#endif
Man::stopSubThreads();
}