]> SALOME platform Git repositories - modules/yacs.git/commitdiff
Salome HOME
Issue CEA914-Access to nb of branches from the plugin.
authorgeay <anthony.geay@cea.fr>
Tue, 8 Apr 2014 07:58:11 +0000 (09:58 +0200)
committergeay <anthony.geay@cea.fr>
Tue, 8 Apr 2014 07:58:11 +0000 (09:58 +0200)
src/engine/OptimizerAlg.cxx
src/engine/OptimizerAlg.hxx
src/engine/OptimizerLoop.cxx

index 457a5d8da945f10b7e77944691162c6690a4a1b0..2d1e80b99143f206a0d2faf5202f23432e2668ce 100644 (file)
@@ -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)
 {
index 11a735d4564e0aa278229224fb538d4f9d67a4b2..56a3b721e89aaf1a71f58db3ea948799818a30c8 100644 (file)
@@ -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;
index 0ed98f67e9fee8b550d29bdc220d5d002572c3e8..b3c0c0010e9554b8aa07ec0b66bcb5079b9d6cec 100644 (file)
@@ -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