Salome HOME
[EDF27816] Management of double foreach and management of proxyfile lifecycle
[modules/yacs.git] / src / engine / ConditionInputPort.cxx
index 1d0280d96ae20829fb57e4e59298789c7b30eac0..0929d11089be426c43d95edb04c67c0335ae6b14 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2015  CEA/DEN, EDF R&D
+// Copyright (C) 2006-2023  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -73,7 +73,7 @@ bool ConditionInputPort::isLinkedOutOfScope() const
   return _outOfScopeBackLink!=0;
 }
 
-void ConditionInputPort::edNotifyReferencedBy(OutPort *fromPort)
+void ConditionInputPort::edNotifyReferencedBy(OutPort *fromPort, bool isLoopProof)
 {
   if(!((ComposedNode*)(_node))->isInMyDescendance(fromPort->getNode()))
     {
@@ -81,7 +81,7 @@ void ConditionInputPort::edNotifyReferencedBy(OutPort *fromPort)
         throw Exception("ConditionInputPort::edNotifyReferenced : already linked from outside");
       _outOfScopeBackLink=fromPort;
     }
-  InputPort::edNotifyReferencedBy(fromPort);
+  InputPort::edNotifyReferencedBy(fromPort,isLoopProof);
 }
 
 void ConditionInputPort::edNotifyDereferencedBy(OutPort *fromPort)
@@ -99,15 +99,21 @@ void *ConditionInputPort::get() const
   return (void *)_value;
 }
 
-void ConditionInputPort::put(const void *data) throw(ConversionException)
+void ConditionInputPort::put(const void *data)
 {
   put((Any*)data);
 }
 
-void ConditionInputPort::put(Any *data) throw(ConversionException)
+void ConditionInputPort::releaseData()
 {
   if(_value)
     _value->decrRef();
+  _value=nullptr;
+}
+
+void ConditionInputPort::put(Any *data)
+{
+  ConditionInputPort::releaseData();
   _value=data;
   _value->incrRef();
 }