Beispiel #1
0
/**
 * Do something after a property was set
 * @param name :: The name of the property
 */
void AlgorithmProxy::afterPropertySet(const std::string &name) {
    createConcreteAlg(true);
    m_alg->getPointerToProperty(name)
    ->setValueFromProperty(*this->getPointerToProperty(name));
    m_alg->afterPropertySet(name);
    copyPropertiesFrom(*m_alg);
}
Beispiel #2
0
/**
* Override setPropertyValue
* @param name The name of the property
* @param value The value of the property as a string
*/
void AlgorithmProxy::setPropertyValue(const std::string &name,
                                      const std::string &value) {
  createConcreteAlg(true);
  m_alg->setPropertyValue(name, value);
  copyPropertiesFrom(*m_alg);
  m_alg.reset();
}
Beispiel #3
0
/** The actions to be performed by the AlgorithmProxy on a dataset. This method
*is
*  invoked for top level AlgorithmProxys by the application manager.
*  This method invokes exec() method.
*  For Child AlgorithmProxys either the execute() method or exec() method
*  must be EXPLICITLY invoked by  the parent AlgorithmProxy.
*
*  @throw runtime_error Thrown if AlgorithmProxy or Child AlgorithmProxy cannot
*be executed
*/
bool AlgorithmProxy::execute() {
    createConcreteAlg(false);
    try {
        m_alg->execute();
    } catch (...) {
        stopped();
        throw;
    }
    stopped();
    return m_isExecuted;
}
Beispiel #4
0
/** executeAsync() implementation.
 * Calls execute and, when it has finished, deletes the real algorithm.
*  @param dummy :: An unused dummy variable
*/
bool AlgorithmProxy::executeAsyncImpl(const Poco::Void &dummy) {
    createConcreteAlg(false);
    // Call Algorithm::executeAsyncImpl rather than executeAsync() because the
    // latter
    // would spawn off another (3rd) thread which is unecessary.
    try {
        m_alg->executeAsyncImpl(
            dummy); // Pass through dummy argument, though not used
    } catch (...) {
        stopped();
        throw;
    }
    stopped();
    return m_isExecuted;
}
Beispiel #5
0
/** Perform whole-input validation */
std::map<std::string, std::string> AlgorithmProxy::validateInputs() {
    if (!m_alg)
        createConcreteAlg(true);
    return m_alg->validateInputs();
}
Beispiel #6
0
/**
 * Copy properties from another property manager
 * Making sure that the concrete alg is kept in sync
 * @param po :: The property manager to copy
 */
void AlgorithmProxy::copyPropertiesFrom(const PropertyManagerOwner &po) {
    PropertyManagerOwner::copyPropertiesFrom(po);
    createConcreteAlg(true);
    m_alg->copyPropertiesFrom(*this);
}