#include "mbwatchmgr.h"
|
|
CMBWatchMgr::CMBWatchMgr()
|
{
|
m_pConst = new CMBWatchConst();
|
|
m_pTaskMgr = new CMBTaskMgr();
|
m_pMdWare = new CMBMdware();
|
m_pTaskMgr->setMdWare(m_pMdWare);
|
|
m_pUserMgr = new CMBWatchUserMgr();
|
m_pUserDb = new CMBWatchUserDb();
|
m_pUserDb->setUserMgr(m_pUserMgr);
|
}
|
|
CMBWatchMgr::~CMBWatchMgr()
|
{
|
if( m_pConst ){
|
delete m_pConst;
|
m_pConst = NULL;
|
}
|
if( m_pUserDb ){
|
delete m_pUserDb;
|
m_pUserDb = NULL;
|
}
|
if(m_pUserMgr){
|
delete m_pUserMgr;
|
m_pUserMgr = NULL;
|
}
|
if( m_pTaskMgr ){
|
delete m_pTaskMgr;
|
m_pTaskMgr = NULL;
|
}
|
|
if( m_pMdWare ){
|
delete m_pMdWare;
|
m_pMdWare = NULL;
|
}
|
}
|
|
CMBWatchConst *CMBWatchMgr::getConst()
|
{
|
return m_pConst;
|
}
|
|
CMBWatchUserMgr *CMBWatchMgr::getUserMgr()
|
{
|
return m_pUserMgr;
|
}
|
|
CMBTaskMgr *CMBWatchMgr::getTaskMgr()
|
{
|
return m_pTaskMgr;
|
}
|
|
CMBMdware *CMBWatchMgr::getMdWare()
|
{
|
return m_pMdWare;
|
}
|
|
bool CMBWatchMgr::init(QString &errInfo)
|
{
|
QString watchUserDB = m_pConst->getWatchUserDB();
|
if(!m_pUserDb->init(watchUserDB,errInfo))
|
return false;
|
|
return true;
|
}
|
|
bool CMBWatchMgr::stop()
|
{
|
m_pTaskMgr->stopThread();
|
|
return true;
|
}
|