Initial
This commit is contained in:
68
watchdog/watchdogservice.cpp
Normal file
68
watchdog/watchdogservice.cpp
Normal file
@@ -0,0 +1,68 @@
|
||||
#include <watchdog/watchdogservice.hpp>
|
||||
#include <watchdog/Evaluator.hpp>
|
||||
#include <common/process.hpp>
|
||||
#include <common/regkey.hpp>
|
||||
|
||||
WatchDogService::WatchDogService()
|
||||
: MessageThread(false)
|
||||
{
|
||||
mThreadHandler.setCallback(this,&WatchDogService::threadHandler);
|
||||
insertHandler(&mThreadHandler);
|
||||
}
|
||||
|
||||
WatchDogService::~WatchDogService()
|
||||
{
|
||||
removeHandler(&mThreadHandler);
|
||||
}
|
||||
|
||||
bool WatchDogService::initialize(void)
|
||||
{
|
||||
start();
|
||||
return true;
|
||||
}
|
||||
|
||||
void WatchDogService::controlStop(void)
|
||||
{
|
||||
stop();
|
||||
mServiceEvent.waitEvent();
|
||||
}
|
||||
|
||||
void WatchDogService::controlPause(void)
|
||||
{
|
||||
}
|
||||
|
||||
void WatchDogService::controlContinue(void)
|
||||
{
|
||||
}
|
||||
|
||||
void WatchDogService::controlInterrogate(void)
|
||||
{
|
||||
}
|
||||
|
||||
void WatchDogService::controlShutdown(void)
|
||||
{
|
||||
stop();
|
||||
}
|
||||
|
||||
DWORD WatchDogService::threadHandler(ThreadMessage &threadMessage)
|
||||
{
|
||||
switch(threadMessage.message())
|
||||
{
|
||||
case ThreadMessage::TM_VOID :
|
||||
break;
|
||||
case ThreadMessage::TM_CREATE :
|
||||
thHandleStart();
|
||||
break;
|
||||
case ThreadMessage::TM_DESTROY :
|
||||
mServiceEvent.setEvent();
|
||||
break;
|
||||
case ThreadMessage::TM_USER :
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void WatchDogService::thHandleStart()
|
||||
{
|
||||
Evaluator::evaluate();
|
||||
}
|
||||
Reference in New Issue
Block a user