Files
qt5-legatus-legacy/TetraIF/PrtCnv/PrtCnvThreadStarter.hpp
2026-08-13 18:33:10 +02:00

88 lines
2.1 KiB
C++

// **************************************************************************
//
// (C) Copyright 2009 Swiss SIMTEC AG
//
// **************************************************************************
//
// $HeadURL$
// $LastChangedBy$
// $LastChangedDate$
// $LastChangedRevision$
//
// Implementation of the Class PrtCnvThreadStarter
// **************************************************************************
#pragma once
#include "PrtCnvApplication.hpp"
#include <QtCore/QThread>
namespace NGL {
class Settings;
}
namespace PrtCnv
{
class PrtCnvThread;
/**
* This class is responsible for starting threads. It also impelements an access
* to other threads.
* @author wia
* @version 1.0
* @updated 21-Jan-2010 08:33:58
*/
class PrtCnvThreadStarter : public QThread
{
Q_OBJECT
protected:
/**
* Pointer to the started thread
*/
PrtCnvThread *m_Thread;
/**
* Pointer to main-application
*/
PrtCnvApplication *m_Application;
/**
* The id of the thread
*/
PrtCnvApplication::E_ThreadId m_Id;
/**
* The settings object
*/
NGL::Settings *m_settings;
/**
* The logger object
*/
NGL::INGLLogger &m_logger;
public:
/**
* Constructor with id and ptr to main-app as parameters.
*
* @param a_id
* @param a_mainApp The pointer to the main-app
*/
PrtCnvThreadStarter(const PrtCnvApplication::E_ThreadId a_id,
const QString &settingsFile,
PrtCnvApplication *a_mainApp);
~PrtCnvThreadStarter();
PrtCnvThread *getThread() const { return m_Thread; }
PrtCnvApplication *getMainApp() const { return m_Application; }
/**
* Returns the desired thread.
*
* @param a_threadId The id of the desired thread.
*/
PrtCnvThread *getOtherThread(PrtCnvApplication::E_ThreadId a_threadId) const;
protected:
/**
* The run()-function, which will be called by Qt-Framework, when starting the
* thread.
*/
void run() override;
};
}