Salome HOME
small debug
[modules/yacs.git] / src / engine / ElementaryNode.cxx
index a2dd127df25324571d0b3591038c75fd6c90e9a0..129deaa1d701bbbc0466d8e007ea257854cb7697 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2015  CEA/DEN, EDF R&D
+// Copyright (C) 2006-2016  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -85,24 +85,25 @@ ElementaryNode::~ElementaryNode()
     delete *iter4;
 }
 
-void ElementaryNode::init(bool start)
+void ElementaryNode::initCommonPartWithoutStateManagement(bool start)
 {
-  DEBTRACE("ElementaryNode::init " << getName() << " " << start << " " << _state);
-
   for(list<OutputPort *>::iterator iter=_setOfOutputPort.begin();iter!=_setOfOutputPort.end();iter++)
     (*iter)->exInit();
   for(list<InputPort *>::iterator iter2=_setOfInputPort.begin();iter2!=_setOfInputPort.end();iter2++)
     (*iter2)->exInit(start);
   _inGate.exReset();
+}
+
+void ElementaryNode::init(bool start)
+{
+  DEBTRACE("ElementaryNode::init " << getName() << " " << start << " " << _state);
+  initCommonPartWithoutStateManagement(start);
   if(_state == YACS::DISABLED)
     {
       exDisabledState(); // to refresh propagation of DISABLED state
-      return;
+      return ;
     }
-  if(start) //complete initialization
-    setState(YACS::READY);
-  else if(_state > YACS::LOADED)//partial initialization (inside a loop)
-    setState(YACS::TORECONNECT);
+  setState(YACS::READY);
 }
 
 bool ElementaryNode::isDeployable() const