
Originally Posted by
OzQTNoob
Hi Wysota,
The Extraction function takes a
QVector<double>
QVector<double>
To copy to clipboard, switch view to plain text mode
as its input and represents a single instance of the mapped input sequence (which I have just noticed is named the same thing e.g spectrain) The mapped spectrain is of the form
QVector<QVector<double> >
QVector<QVector<double> >
To copy to clipboard, switch view to plain text mode
. The actual declaration of Extraction within the feature_finder class is given below
QVector<QVector<QVector<QVector<double> > > > feature_finder::Extraction(QVector<double> spectrain)
QVector<QVector<QVector<QVector<double> > > > feature_finder::Extraction(QVector<double> spectrain)
To copy to clipboard, switch view to plain text mode
This is a correct call to mapped then:
#include <QtConcurrentMap>
#include <QVector>
QVector<QVector<double> > mapFunc(const QVector<double> inData) {
return QVector<QVector<double> >();
}
int main(int argc, char **argv) {
QVector<QVector<double> > inVector;
QFuture<void> future = QtConcurrent::mapped(inVector, mapFunc);
return 0;
}
#include <QtConcurrentMap>
#include <QVector>
QVector<QVector<double> > mapFunc(const QVector<double> inData) {
return QVector<QVector<double> >();
}
int main(int argc, char **argv) {
QVector<QVector<double> > inVector;
QFuture<void> future = QtConcurrent::mapped(inVector, mapFunc);
return 0;
}
To copy to clipboard, switch view to plain text mode
After the thread is done, "inVector" will contain the result of the call.
Can you expand a little on the
bit. If I can have a functor set these prior to the call to mapped() then it would help me a lot.
I'm not sure what to expand. The docs contain an example of using a functor (function object), just have a look at it.
Why not? You could post some custom events and then grab them and process them elsewhere.
Bookmarks