14 #include <QStringList> 44 if (mCurrent >= 0 && mCurrent <
mChildren.size())
56 reportError(
"Attempt to restart CompositeSerialTimedAlgorithm while running failed.");
72 this->jumpToNextChild();
75 void CompositeSerialTimedAlgorithm::jumpToNextChild()
78 if (mCurrent >= 0 && mCurrent <
mChildren.size())
80 disconnect(
mChildren[mCurrent].
get(), SIGNAL(
finished()),
this, SLOT(jumpToNextChild()));
84 if (mCurrent >= 0 && mCurrent <
mChildren.size())
86 connect(
mChildren[mCurrent].
get(), SIGNAL(
finished()),
this, SLOT(jumpToNextChild()));
102 return mCurrent == -1;
107 return mCurrent >= 0;
121 QStringList products;
122 for (
unsigned i=0; i<
mChildren.size(); ++i)
127 if (products.isEmpty())
128 return "composite parallel";
130 return products.join(
", ");
139 reportError(
"Attempt to restart CompositeSerialTimedAlgorithm while running failed.");
150 for (
unsigned i=0; i<
mChildren.size(); ++i)
154 for (
unsigned i=0; i<
mChildren.size(); ++i)
160 void CompositeParallelTimedAlgorithm::oneFinished()
171 for (
unsigned i=0; i<
mChildren.size(); ++i)
virtual bool isRunning() const
void finished()
should be emitted when at the end of postProcessingSlot
virtual bool isFinished() const
void reportError(QString msg)
CompositeTimedAlgorithm(QString name)
Base class for algorithms that wants to time their execution.
CompositeParallelTimedAlgorithm(QString name="parallel")
virtual QString getProduct() const
virtual QString getProduct() const
virtual bool isRunning() const
virtual bool isFinished() const
boost::shared_ptr< class TimedBaseAlgorithm > TimedAlgorithmPtr
CompositeSerialTimedAlgorithm(QString name="composite")
std::vector< TimedAlgorithmPtr > mChildren
void productChanged()
emitted whenever product string has changed
void aboutToStart()
emitted at start of execute. Use to perform preprocessing
virtual void append(TimedAlgorithmPtr child)
void started(int maxSteps)
emitted at start of run.
Namespace for all CustusX production code.