Sfoglia il codice sorgente

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 anni fa
parent
commit
e501e585e9
1 ha cambiato i file con 23 aggiunte e 20 eliminazioni
  1. 23
    20
      TestService/serviceProgram.cpp

+ 23
- 20
TestService/serviceProgram.cpp Vedi File

@@ -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;

Loading…
Annulla
Salva