##// END OF EJS Templates
Add access to DataSourceController from SqpApplication
Add access to DataSourceController from SqpApplication

File last commit:

r33:2b201d277e22
r33:2b201d277e22
Show More
SqpApplication.cpp
51 lines | 1.5 KiB | text/x-c | CppLexer
/ gui / src / SqpApplication.cpp
Initialisation de l'application multithread avec le spimpl....
r21 #include "SqpApplication.h"
#include <DataSource/DataSourceController.h>
#include <QThread>
Q_LOGGING_CATEGORY(LOG_SqpApplication, "SqpApplication")
class SqpApplication::SqpApplicationPrivate {
public:
Alexandre Leroux
Minor fixes...
r32 SqpApplicationPrivate() : m_DataSourceController{std::make_unique<DataSourceController>()}
{
m_DataSourceController->moveToThread(&m_DataSourceControllerThread);
}
Ajout des règles vera++
r24 virtual ~SqpApplicationPrivate()
Ajout de la méthode wait pour éviter de détruire un thread en cours...
r22 {
Alexandre Leroux
Minor fixes...
r32 qCInfo(LOG_SqpApplication()) << tr("SqpApplicationPrivate destruction");
Ajout de la méthode wait pour éviter de détruire un thread en cours...
r22 m_DataSourceControllerThread.quit();
m_DataSourceControllerThread.wait();
}
Initialisation de l'application multithread avec le spimpl....
r21
std::unique_ptr<DataSourceController> m_DataSourceController;
QThread m_DataSourceControllerThread;
};
SqpApplication::SqpApplication(int &argc, char **argv)
Alexandre Leroux
Minor fixes...
r32 : QApplication{argc, argv}, impl{spimpl::make_unique_impl<SqpApplicationPrivate>()}
Initialisation de l'application multithread avec le spimpl....
r21 {
Alexandre Leroux
Minor fixes...
r32 qCInfo(LOG_SqpApplication()) << tr("SqpApplication construction");
Initialisation de l'application multithread avec le spimpl....
r21
connect(&impl->m_DataSourceControllerThread, &QThread::started,
impl->m_DataSourceController.get(), &DataSourceController::initialize);
connect(&impl->m_DataSourceControllerThread, &QThread::finished,
impl->m_DataSourceController.get(), &DataSourceController::finalize);
impl->m_DataSourceControllerThread.start();
}
SqpApplication::~SqpApplication()
{
}
void SqpApplication::initialize()
{
}
Alexandre Leroux
Add access to DataSourceController from SqpApplication
r33
DataSourceController &SqpApplication::dataSourceController() const noexcept
{
return *impl->m_DataSourceController;
}