35 #include <QStringList>
65 if (mCurrent >= 0 && mCurrent <
mChildren.size())
77 reportError(
"Attempt to restart CompositeSerialTimedAlgorithm while running failed.");
93 this->jumpToNextChild();
96 void CompositeSerialTimedAlgorithm::jumpToNextChild()
99 if (mCurrent >= 0 && mCurrent <
mChildren.size())
101 disconnect(
mChildren[mCurrent].
get(), SIGNAL(
finished()),
this, SLOT(jumpToNextChild()));
105 if (mCurrent >= 0 && mCurrent <
mChildren.size())
107 connect(
mChildren[mCurrent].
get(), SIGNAL(
finished()),
this, SLOT(jumpToNextChild()));
123 return mCurrent == -1;
128 return mCurrent >= 0;
142 QStringList products;
143 for (
unsigned i=0; i<
mChildren.size(); ++i)
148 if (products.isEmpty())
149 return "composite parallel";
151 return products.join(
", ");
160 reportError(
"Attempt to restart CompositeSerialTimedAlgorithm while running failed.");
171 for (
unsigned i=0; i<
mChildren.size(); ++i)
175 for (
unsigned i=0; i<
mChildren.size(); ++i)
181 void CompositeParallelTimedAlgorithm::oneFinished()
192 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.