Salome HOME
Use tempfile.mkdtemp to create temporary directory
[modules/yacs.git] / src / engine / AnyOutputPort.cxx
index 792b487b5ce2bb9a07ad20fcc92dd48d265f4852..1dc981009d15dd67fae1fc9dd8708f94b796b68d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2014  CEA/DEN, EDF R&D
+// Copyright (C) 2006-2022  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
@@ -18,8 +18,9 @@
 //
 
 #include "AnyOutputPort.hxx"
-#include "Any.hxx"
+#include "AutoLocker.hxx"
 #include "Runtime.hxx"
+#include "Any.hxx"
 
 //#define _DEVDEBUG_
 #include "YacsTrace.hxx"
@@ -47,7 +48,7 @@ AnyOutputPort::~AnyOutputPort()
 //! store the current dispatched value
 void AnyOutputPort::setValue(Any *data) 
 {
-  YACS::BASES::Lock lock(&_mutex);
+  YACS::BASES::AutoLocker<YACS::BASES::Mutex> lock(&_mutex);
   if(_data)
     _data->decrRef();
   _data = data; 
@@ -60,12 +61,12 @@ OutputPort *AnyOutputPort::clone(Node *newHelder) const
   return new AnyOutputPort(*this,newHelder);
 }
 
-void AnyOutputPort::put(const void *data) throw(ConversionException)
+void AnyOutputPort::put(const void *data)
 {
   put((YACS::ENGINE::Any *)data);
 }
 
-void AnyOutputPort::put(YACS::ENGINE::Any *data) throw(ConversionException)
+void AnyOutputPort::put(YACS::ENGINE::Any *data)
 {
   setValue(data);
   OutputPort::put(data);
@@ -73,6 +74,6 @@ void AnyOutputPort::put(YACS::ENGINE::Any *data) throw(ConversionException)
 
 std::string AnyOutputPort::getAsString()
 {
-  YACS::BASES::Lock lock(&_mutex);
+  YACS::BASES::AutoLocker<YACS::BASES::Mutex> lock(&_mutex);
   return getRuntime()->convertNeutralAsString(edGetType(),_data);
 }