Skip to content

Commit

Permalink
Allow Analyst *and* Analyst's FPStream object to be moved to another …
Browse files Browse the repository at this point in the history
…thread through a single function call, by overriding the moveToThread() method.
  • Loading branch information
wimleers committed Jun 12, 2011
1 parent 4e7a842 commit d55f0bc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions code/Analytics/Analyst.cpp
Expand Up @@ -50,6 +50,15 @@ namespace Analytics {
this->ruleConsequentItemConstraints.addItemConstraint(item, type);
}

/**
* Override of QObject::moveToThread(), to automatically also move the
* FPStream object to the other thread.
*/
void Analyst::moveToThread(QThread * thread) {
QObject::moveToThread(thread);
this->fpstream->moveToThread(thread);
}


//------------------------------------------------------------------------
// Public slots.
Expand Down
3 changes: 3 additions & 0 deletions code/Analytics/Analyst.h
Expand Up @@ -25,6 +25,9 @@ namespace Analytics {
void addFrequentItemsetItemConstraint(ItemName item, ItemConstraintType type);
void addRuleConsequentItemConstraint(ItemName item, ItemConstraintType type);

// Override moveToThread to also move the FPStream instance.
void moveToThread(QThread * thread);

signals:
void minedRules(uint from, uint to, QList<AssociationRule> associationRules);
void comparedMinedRules(uint fromOlder, uint toOlder,
Expand Down

0 comments on commit d55f0bc

Please sign in to comment.