##// END OF EJS Templates
Minor fixes...
Alexandre Leroux -
r32:8866878c2cb6
parent child
Show More
@@ -1,3 +1,5
1 1 build/
2 2 CMakeLists.txt.user
3 3 /.project
4 core/src/Version.cpp
5 core/include/Version.h
@@ -27,8 +27,7
27 27
28 28 int main(int argc, char *argv[])
29 29 {
30 int ad;
31 SqpApplication a(argc, argv);
30 SqpApplication a{argc, argv};
32 31 SqpApplication::setOrganizationName("LPP");
33 32 SqpApplication::setOrganizationDomain("lpp.fr");
34 33 SqpApplication::setApplicationName("SciQLop");
@@ -89,8 +89,9 using default_copier_t = typename default_copier<T>::type;
89 89
90 90 template <class T, class D, class C>
91 91 struct is_default_manageable
92 : public std::integral_constant<bool, std::is_same<D, default_deleter_t<T> >::value
93 && std::is_same<C, default_copier_t<T> >::value> {
92 : public std::integral_constant<bool,
93 std::is_same<D, default_deleter_t<T> >::value
94 && std::is_same<C, default_copier_t<T> >::value> {
94 95 };
95 96 }
96 97
@@ -131,10 +132,11 public:
131 132 }
132 133
133 134 template <class U>
134 impl_ptr(U *u, typename std::enable_if<std::is_convertible<U *, pointer>::value
135 && is_default_manageable::value,
136 dummy_t_>::type
137 = dummy_t_()) SPIMPL_NOEXCEPT
135 impl_ptr(U *u,
136 typename std::enable_if<std::is_convertible<U *, pointer>::value
137 && is_default_manageable::value,
138 dummy_t_>::type
139 = dummy_t_()) SPIMPL_NOEXCEPT
138 140 : impl_ptr(u, &details::default_delete<T>, &details::default_copy<T>)
139 141 {
140 142 }
@@ -151,12 +153,12 public:
151 153
152 154 #ifdef SPIMPL_HAS_AUTO_PTR
153 155 template <class U>
154 impl_ptr(std::auto_ptr<U> &&u, typename std::enable_if<std::is_convertible<U *, pointer>::value
155 && is_default_manageable::value,
156 dummy_t_>::type
157 = dummy_t_()) SPIMPL_NOEXCEPT
158 : ptr_(u.release(), &details::default_delete<T>),
159 copier_(&details::default_copy<T>)
156 impl_ptr(std::auto_ptr<U> &&u,
157 typename std::enable_if<std::is_convertible<U *, pointer>::value
158 && is_default_manageable::value,
159 dummy_t_>::type
160 = dummy_t_()) SPIMPL_NOEXCEPT : ptr_(u.release(), &details::default_delete<T>),
161 copier_(&details::default_copy<T>)
160 162 {
161 163 }
162 164 #endif
@@ -1,8 +1,6
1 1 #ifndef SCIQLOP_DATASOURCECONTROLLER_H
2 2 #define SCIQLOP_DATASOURCECONTROLLER_H
3 3
4 #include "DataSourceController.h"
5
6 4 #include <QLoggingCategory>
7 5 #include <QObject>
8 6
@@ -1,4 +1,4
1 #include "DataSource/DataSourceController.h"
1 #include <DataSource/DataSourceController.h>
2 2
3 3 #include <QMutex>
4 4 #include <QThread>
@@ -10,31 +10,29 Q_LOGGING_CATEGORY(LOG_DataSourceController, "DataSourceController")
10 10
11 11 class DataSourceController::DataSourceControllerPrivate {
12 12 public:
13 DataSourceControllerPrivate() {}
14
15 13 QMutex m_WorkingMutex;
16 14 };
17 15
18 16 DataSourceController::DataSourceController(QObject *parent)
19 17 : impl{spimpl::make_unique_impl<DataSourceControllerPrivate>()}
20 18 {
21 qCDebug(LOG_DataSourceController()) << tr("Construction du DataSourceController")
22 << QThread::currentThread();
19 qCDebug(LOG_DataSourceController())
20 << tr("DataSourceController construction") << QThread::currentThread();
23 21 }
24 22
25 23 DataSourceController::~DataSourceController()
26 24 {
27 qCDebug(LOG_DataSourceController()) << tr("Desctruction du DataSourceController")
28 << QThread::currentThread();
25 qCDebug(LOG_DataSourceController())
26 << tr("DataSourceController destruction") << QThread::currentThread();
29 27 this->waitForFinish();
30 28 }
31 29
32 30 void DataSourceController::initialize()
33 31 {
34 qCDebug(LOG_DataSourceController()) << tr("initialize du DataSourceController")
35 << QThread::currentThread();
32 qCDebug(LOG_DataSourceController())
33 << tr("DataSourceController init") << QThread::currentThread();
36 34 impl->m_WorkingMutex.lock();
37 qCDebug(LOG_DataSourceController()) << tr("initialize du DataSourceController END");
35 qCDebug(LOG_DataSourceController()) << tr("DataSourceController init END");
38 36 }
39 37
40 38 void DataSourceController::finalize()
@@ -44,5 +42,5 void DataSourceController::finalize()
44 42
45 43 void DataSourceController::waitForFinish()
46 44 {
47 QMutexLocker locker(&impl->m_WorkingMutex);
45 QMutexLocker locker{&impl->m_WorkingMutex};
48 46 }
@@ -12,10 +12,10 Q_DECLARE_LOGGING_CATEGORY(LOG_SqpApplication)
12 12
13 13 /**
14 14 * @brief The SqpApplication class aims to make the link between SciQlop
15 * and its plugins. This is the intermediate class that SciQlop have to use
16 * in the way to connect a data source. Please first use load method to intialize
15 * and its plugins. This is the intermediate class that SciQlop has to use
16 * in the way to connect a data source. Please first use load method to initialize
17 17 * a plugin specified by its metadata name (JSON plugin source) then others specifics
18 * method will ba able to access it.
18 * method will be able to access it.
19 19 * You can load a data source driver plugin then create a data source.
20 20 */
21 21
@@ -7,10 +7,14 Q_LOGGING_CATEGORY(LOG_SqpApplication, "SqpApplication")
7 7
8 8 class SqpApplication::SqpApplicationPrivate {
9 9 public:
10 SqpApplicationPrivate() {}
10 SqpApplicationPrivate() : m_DataSourceController{std::make_unique<DataSourceController>()}
11 {
12 m_DataSourceController->moveToThread(&m_DataSourceControllerThread);
13 }
14
11 15 virtual ~SqpApplicationPrivate()
12 16 {
13 qCInfo(LOG_SqpApplication()) << tr("Desctruction du SqpApplicationPrivate");
17 qCInfo(LOG_SqpApplication()) << tr("SqpApplicationPrivate destruction");
14 18 m_DataSourceControllerThread.quit();
15 19 m_DataSourceControllerThread.wait();
16 20 }
@@ -21,12 +25,9 public:
21 25
22 26
23 27 SqpApplication::SqpApplication(int &argc, char **argv)
24 : QApplication(argc, argv), impl{spimpl::make_unique_impl<SqpApplicationPrivate>()}
28 : QApplication{argc, argv}, impl{spimpl::make_unique_impl<SqpApplicationPrivate>()}
25 29 {
26 qCInfo(LOG_SqpApplication()) << tr("Construction du SqpApplication");
27
28 impl->m_DataSourceController = std::make_unique<DataSourceController>();
29 impl->m_DataSourceController->moveToThread(&impl->m_DataSourceControllerThread);
30 qCInfo(LOG_SqpApplication()) << tr("SqpApplication construction");
30 31
31 32 connect(&impl->m_DataSourceControllerThread, &QThread::started,
32 33 impl->m_DataSourceController.get(), &DataSourceController::initialize);
General Comments 0
You need to be logged in to leave comments. Login now