88 lines
1.9 KiB
C++
88 lines
1.9 KiB
C++
// **************************************************************************
|
|
//
|
|
// (C) Copyright 2009 Swiss SIMTEC AG
|
|
//
|
|
// **************************************************************************
|
|
//
|
|
// $HeadURL$
|
|
// $LastChangedBy$
|
|
// $LastChangedDate$
|
|
// $LastChangedRevision$
|
|
//
|
|
// Implementation of the Class PrtCnvThread
|
|
// **************************************************************************
|
|
#pragma once
|
|
|
|
#include "IAppComponent.hpp"
|
|
#include "logger.h"
|
|
#include <QObject>
|
|
|
|
|
|
namespace PrtCnv
|
|
{
|
|
class PrtCnvThreadStarter;
|
|
/**
|
|
* The father-class of all threads in protocol-converter. It implements access to
|
|
* config-system and knows whether we have a restart after crash or a normal start
|
|
* (from scratch).
|
|
* @author wia
|
|
* @version 1.0
|
|
* @updated 21-Jan-2010 08:38:23
|
|
*/
|
|
class PrtCnvThread : public QObject, public N_AppComponent::IAppComponent
|
|
{
|
|
Q_OBJECT
|
|
protected:
|
|
/**
|
|
* Used to get configuration-parameter
|
|
*/
|
|
NGL::Settings* m_Config;
|
|
/**
|
|
* Pointer to ThreadStarter
|
|
*/
|
|
PrtCnvThreadStarter *m_Parent;
|
|
/**
|
|
* @brief The Id of the current thread (for debug purposes)
|
|
*/
|
|
Qt::HANDLE m_currentThreadId;
|
|
/**
|
|
* The logger object
|
|
*/
|
|
NGL::INGLLogger &m_logger;
|
|
|
|
public:
|
|
/**
|
|
* Indicates what happens with the DB while startup. True => it will be cleant;
|
|
* False => it will be restored (after crash). This variable will be True at
|
|
* startup when you use the parameter --cleandb when starting PrtCnv.
|
|
*/
|
|
static bool m_DoCleanDb;
|
|
/**
|
|
* Constructor with thread-starter as parameter
|
|
*
|
|
* @param a_parent
|
|
*/
|
|
PrtCnvThread(PrtCnvThreadStarter* a_parent, const char *loggerName);
|
|
|
|
|
|
int32_t create(NGL::Settings *settings) override;
|
|
|
|
|
|
int32_t init() override;
|
|
|
|
|
|
int32_t start() override;
|
|
|
|
|
|
int32_t stop() override;
|
|
|
|
|
|
int32_t deinit() override;
|
|
|
|
|
|
int32_t destroy() override;
|
|
|
|
};
|
|
|
|
}
|