|
|
@@ -101,11 +101,8 @@ StopCallback notStopCbck; |
|
|
|
|
|
|
|
int CodeDweller::Service::run() { |
|
|
|
|
|
|
|
// Get the singleton. |
|
|
|
CodeDweller::Service &svc = CodeDweller::Service::getInstance(); |
|
|
|
|
|
|
|
// Get the log file name. |
|
|
|
auto arguments = svc.arguments(); |
|
|
|
auto arguments = CodeDweller::Service::arguments(); |
|
|
|
|
|
|
|
if (arguments.size() != 2) { |
|
|
|
return(EXIT_FAILURE); |
|
|
@@ -115,14 +112,14 @@ int CodeDweller::Service::run() { |
|
|
|
std::ofstream logStream(arguments[1]); |
|
|
|
|
|
|
|
// Register the callbacks. |
|
|
|
svc.onPauseCall(pauseCbck); |
|
|
|
svc.onPauseCall(pauseCbck1); |
|
|
|
CodeDweller::Service::onPauseCall(pauseCbck); |
|
|
|
CodeDweller::Service::onPauseCall(pauseCbck1); |
|
|
|
|
|
|
|
svc.onResumeCall(resumeCbck); |
|
|
|
svc.onResumeCall(resumeCbck1); |
|
|
|
CodeDweller::Service::onResumeCall(resumeCbck); |
|
|
|
CodeDweller::Service::onResumeCall(resumeCbck1); |
|
|
|
|
|
|
|
svc.onStopCall(stopCbck); |
|
|
|
svc.onStopCall(stopCbck1); |
|
|
|
CodeDweller::Service::onStopCall(stopCbck); |
|
|
|
CodeDweller::Service::onStopCall(stopCbck1); |
|
|
|
|
|
|
|
while (!stopCbck.stopFlag) { |
|
|
|
|
|
|
@@ -131,18 +128,24 @@ int CodeDweller::Service::run() { |
|
|
|
std::this_thread::sleep_for(std::chrono::milliseconds(2000)); |
|
|
|
logStream << "done." << std::endl; |
|
|
|
|
|
|
|
logStream << "receivedPause(): " << svc.receivedPause() << std::endl; |
|
|
|
logStream << "receivedResume(): " << svc.receivedResume() << std::endl; |
|
|
|
logStream << "receivedStop(): " << svc.receivedStop() << std::endl; |
|
|
|
logStream << "receivedPause(): " |
|
|
|
<< CodeDweller::Service::receivedPause() << std::endl; |
|
|
|
logStream << "receivedResume(): " |
|
|
|
<< CodeDweller::Service::receivedResume() << std::endl; |
|
|
|
logStream << "receivedStop(): " |
|
|
|
<< CodeDweller::Service::receivedStop() << std::endl; |
|
|
|
|
|
|
|
logStream << "Clearing all flags." << std::endl; |
|
|
|
svc.clearReceivedPause(); |
|
|
|
svc.clearReceivedResume(); |
|
|
|
svc.clearReceivedStop(); |
|
|
|
|
|
|
|
logStream << "receivedPause(): " << svc.receivedPause() << std::endl; |
|
|
|
logStream << "receivedResume(): " << svc.receivedResume() << std::endl; |
|
|
|
logStream << "receivedStop(): " << svc.receivedStop() << std::endl; |
|
|
|
CodeDweller::Service::clearReceivedPause(); |
|
|
|
CodeDweller::Service::clearReceivedResume(); |
|
|
|
CodeDweller::Service::clearReceivedStop(); |
|
|
|
|
|
|
|
logStream << "receivedPause(): " |
|
|
|
<< CodeDweller::Service::receivedPause() << std::endl; |
|
|
|
logStream << "receivedResume(): " |
|
|
|
<< CodeDweller::Service::receivedResume() << std::endl; |
|
|
|
logStream << "receivedStop(): " |
|
|
|
<< CodeDweller::Service::receivedStop() << std::endl; |
|
|
|
|
|
|
|
logStream << "pauseCbck.pauseFlag: " << pauseCbck.pauseFlag << std::endl; |
|
|
|
logStream << "pauseCbck1.pauseFlag: " << pauseCbck1.pauseFlag << std::endl; |