Browse Source

Made set/clear functions static, made entry point functions private.


git-svn-id: https://svn.microneil.com/svn/CodeDweller-Tests/trunk@22 b3372362-9eaa-4a85-aa2b-6faa1ab7c995
master
adeniz 10 years ago
parent
commit
e501e585e9
1 changed files with 23 additions and 20 deletions
  1. 23
    20
      TestService/serviceProgram.cpp

+ 23
- 20
TestService/serviceProgram.cpp View File



int CodeDweller::Service::run() { int CodeDweller::Service::run() {


// Get the singleton.
CodeDweller::Service &svc = CodeDweller::Service::getInstance();

// Get the log file name. // Get the log file name.
auto arguments = svc.arguments();
auto arguments = CodeDweller::Service::arguments();


if (arguments.size() != 2) { if (arguments.size() != 2) {
return(EXIT_FAILURE); return(EXIT_FAILURE);
std::ofstream logStream(arguments[1]); std::ofstream logStream(arguments[1]);
// Register the callbacks. // 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) { while (!stopCbck.stopFlag) {


std::this_thread::sleep_for(std::chrono::milliseconds(2000)); std::this_thread::sleep_for(std::chrono::milliseconds(2000));
logStream << "done." << std::endl; 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; 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 << "pauseCbck.pauseFlag: " << pauseCbck.pauseFlag << std::endl;
logStream << "pauseCbck1.pauseFlag: " << pauseCbck1.pauseFlag << std::endl; logStream << "pauseCbck1.pauseFlag: " << pauseCbck1.pauseFlag << std::endl;

Loading…
Cancel
Save