Salome HOME
Updated copyright comment
[modules/yacs.git] / src / engine / Switch.cxx
index 631d697b7ad5aa02e7b1e028a74bfe28478930c7..2085096cbef0ef1685b433238bb3745828e2647b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2020  CEA/DEN, EDF R&D
+// Copyright (C) 2006-2024  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -82,15 +82,16 @@ void CollectorSwOutPort::getAllRepresented(std::set<OutPort *>& represented) con
 
 bool CollectorSwOutPort::addInPort(InPort *inPort)
 {
+  bool ret = false;
   if(_currentProducer)
     {//a specific link is beeing done
-      bool ret=_currentProducer->addInPort(inPort);
+      ret=_currentProducer->addInPort(inPort);
       _currentProducer=0;
-      return ret;
     }
   else//global links asked
     for(map<int, OutPort *>::iterator iter=_potentialProducers.begin();iter!=_potentialProducers.end();iter++)
-      (*iter).second->addInPort(inPort);
+      ret |= (*iter).second->addInPort(inPort);
+  return ret;
 }
 
 int CollectorSwOutPort::removeInPort(InPort *inPort, bool forward)
@@ -113,7 +114,10 @@ CollectorSwOutPort::CollectorSwOutPort(Switch *master, InPort *port):OutPort("",
                                                                      Port(master),
                                                                      _consumer(port),_currentProducer(0)
 {
-  _name="Representant_of_"; _name+=master->getName(); _name+="_for_inport_"; _name+=master->getRootNode()->getInPortName(_consumer);
+  _name="Representant_of_";
+  _name+=master->getName();
+  _name+="_for_inport_";
+  _name+=port->getName();
 }
 
 CollectorSwOutPort::CollectorSwOutPort(const CollectorSwOutPort& other, Switch *master):OutPort("",master,other.edGetType()),
@@ -559,6 +563,7 @@ Node *Switch::edSetNode(int caseId, Node *node)
           return ret;
         }
     }
+  return 0;
 }
 
 //! Change the case of a node