]> SALOME platform Git repositories - modules/yacs.git/blobdiff - src/engine/DynParaLoop.hxx
Salome HOME
Ready to unplug nbOfBranches from foreach
[modules/yacs.git] / src / engine / DynParaLoop.hxx
index 1ff196e95676b7ea3337702ff185fd82172751a3..8e58bd4991c774052c0dcee229341b05fd4780b7 100644 (file)
@@ -27,6 +27,8 @@
 #include "OutputPort.hxx"
 #include "NbBranches.hxx"
 
+#include <memory>
+
 namespace YACS
 {
   namespace ENGINE
@@ -50,7 +52,8 @@ namespace YACS
       Node *_finalizeNode;
       unsigned _nbOfEltConsumed;
       std::vector<int> _execIds;
-      NbBranches _nbOfBranches;
+      //NbBranches _nbOfBranches2;
+      std::unique_ptr<NbBranchesAbstract> _nbOfBranches;
       AnyOutputPort _splittedPort;
       std::vector<Node *> _execNodes;
       std::vector<Node *> _execInitNodes;
@@ -64,7 +67,7 @@ namespace YACS
       static const char NAME_OF_SPLITTED_SEQ_OUT[];
       static const char OLD_NAME_OF_SPLITTED_SEQ_OUT[];
     protected:
-      DynParaLoop(const std::string& name, TypeCode *typeOfDataSplitted);
+      DynParaLoop(const std::string& name, TypeCode *typeOfDataSplitted, std::unique_ptr<NbBranchesAbstract>&& branchManager);
       virtual ~DynParaLoop();
       DynParaLoop(const DynParaLoop& other, ComposedNode *father, bool editionOnly);
     public:
@@ -77,7 +80,7 @@ namespace YACS
       Node *edSetFinalizeNode(Node *DISOWNnode);
       virtual bool edAddDFLink(OutPort *start, InPort *end) throw(Exception);
       void init(bool start=true);
-      InputPort *edGetNbOfBranchesPort() { return _nbOfBranches.getPort(); }
+      InputPort *edGetNbOfBranchesPort() { return _nbOfBranches->getPort(); }
       int getNumberOfInputPorts() const;
       int getNumberOfOutputPorts() const;
       unsigned getNumberOfEltsConsumed() const { return _nbOfEltConsumed; }