Ignore:
Timestamp:
Oct 10, 2019 2:41:07 PM (2 months ago)
Author:
Christian Andersson
Message:

Recommitted changeset:13700 to trunk with two bug fixes. Related to ticket:5837

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/Compiler/ModelicaFlatTree/src/jastadd/ConstantEvaluation/ExternalConstantEvaluation.jrag

    r13703 r13719  
    2626import java.util.TimerTask;
    2727
     28import org.jmodelica.common.evaluation.ExternalFunctionCompiler;
    2829import org.jmodelica.common.evaluation.ExternalFunction;
    2930import org.jmodelica.common.evaluation.ExternalProcessCache;
    3031import org.jmodelica.common.evaluation.ExternalProcessCacheImpl;
    3132import org.jmodelica.common.evaluation.ExternalProcessMultiCache;
     33import org.jmodelica.common.evaluation.FailedExternalFunction;
    3234import org.jmodelica.common.evaluation.ProcessCommunicator;
    3335
     
    4951    class ModelicaCompiler {}
    5052   
    51     ModelicaCompiler   implements ExternalProcessMultiCache.Compiler<ExternalArgument, FExternalStmt>;
     53    ModelicaCompiler   implements ExternalFunctionCompiler<ExternalArgument, FExternalStmt>;
    5254    FExternalStmt      implements ExternalProcessMultiCache.External<ExternalArgument>;
    5355    ExternalArgument   extends    ExternalProcessMultiCache.Variable<CValue,FType>;
     
    8991     * Check if this external function should be cached as a live process.
    9092     */
    91     syn boolean FExternalStmt.shouldCacheProcess() {
    92         return myOptions().getIntegerOption("external_constant_evaluation_max_proc") > 0;
    93     }
     93    syn int FExternalStmt.processLimit() =
     94            myOptions().external_constant_evaluation_max_proc.getValue();
     95   
     96    syn boolean FExternalStmt.dynamicEvaluatorEnabled() =
     97            myOptions().external_constant_evaluation_dynamic.getValue()
     98            && !externalObjectsToSerialize().iterator().hasNext();
    9499   
    95100    /**
     
    169174        ExternalFunctionCache efc = root().getUtilInterface().getExternalFunctionCache();
    170175        if (efc == null) {
    171             return new ExternalProcessCacheImpl<>(root().getUtilInterface().getModelicaCompiler())
    172                 .failedEval(this, "external function cache unavailable", false);
     176            return FailedExternalFunction.<ExternalArgument, CValue, FType, FExternalStmt>failedEval(
     177                    root().getUtilInterface().getModelicaCompiler(),
     178                    this, "external function cache unavailable", false);
    173179        }
    174180        return efc.getExternalProcessCache(getLibTopPackagePath()).getExternalFunction(this);
     
    205211       
    206212        if (error != null) {
    207             throw new ConstantEvaluationException(null, ExternalProcessCacheImpl.failedEvalMsg(getName(), error));
     213            throw new ConstantEvaluationException(null, FailedExternalFunction.failedEvalMsg(getName(), error));
    208214        }
    209215       
Note: See TracChangeset for help on using the changeset viewer.