From d1b973854e2ed319c362c7888b08aa651ab98339 Mon Sep 17 00:00:00 2001 From: geay Date: Tue, 8 Apr 2014 09:58:11 +0200 Subject: [PATCH] Issue CEA914-Access to nb of branches from the plugin. --- src/engine/OptimizerAlg.cxx | 9 +++++++++ src/engine/OptimizerAlg.hxx | 4 +++- src/engine/OptimizerLoop.cxx | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/engine/OptimizerAlg.cxx b/src/engine/OptimizerAlg.cxx index 457a5d8da..2d1e80b99 100644 --- a/src/engine/OptimizerAlg.cxx +++ b/src/engine/OptimizerAlg.cxx @@ -130,6 +130,15 @@ void OptimizerAlgBase::setError(const std::string & message) _errorMessage = (message.length() > 0) ? message : "Unknown error"; } +void OptimizerAlgBase::setNbOfBranches(int nbOfBranches) +{ + _nbOfBranches=nbOfBranches; +} + +int OptimizerAlgBase::getNbOfBranches() const +{ + return _nbOfBranches; +} OptimizerAlgASync::OptimizerAlgASync(Pool *pool):OptimizerAlgBase(pool) { diff --git a/src/engine/OptimizerAlg.hxx b/src/engine/OptimizerAlg.hxx index 11a735d45..56a3b721e 100644 --- a/src/engine/OptimizerAlg.hxx +++ b/src/engine/OptimizerAlg.hxx @@ -44,6 +44,7 @@ namespace YACS Pool *_pool; Proc * _proc; std::string _errorMessage; + int _nbOfBranches; protected: OptimizerAlgBase(Pool *pool); @@ -86,7 +87,8 @@ namespace YACS virtual bool hasError() const; virtual const std::string & getError() const; virtual void setError(const std::string & message); - + void setNbOfBranches(int nbOfBranches); + int getNbOfBranches() const; }; typedef OptimizerAlgBase OptimizerAlgSync; diff --git a/src/engine/OptimizerLoop.cxx b/src/engine/OptimizerLoop.cxx index 0ed98f67e..b3c0c0010 100644 --- a/src/engine/OptimizerLoop.cxx +++ b/src/engine/OptimizerLoop.cxx @@ -180,6 +180,7 @@ void OptimizerLoop::exUpdateState() //internal graph update int i; int nbOfBr=_nbOfBranches.getIntValue(); + _alg->setNbOfBranches(nbOfBr); if(nbOfBr==0) { // A number of branches of 0 is acceptable if there are no output ports -- 2.39.2