Salome HOME
Solve problem of non install of includes of src/engine/.hxx into install/include...
[modules/yacs.git] / src / engine / AnyInputPort.cxx
old mode 100755 (executable)
new mode 100644 (file)
index dceb3b4..3db6b63
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2014  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
 
 #include "AnyInputPort.hxx"
 #include "TypeCode.hxx"
-#include <iostream>
-#include <sstream>
 #include "Mutex.hxx"
+#include "AutoLocker.hxx"
 
 //#define _DEVDEBUG_
 #include "YacsTrace.hxx"
 
+#include <iostream>
+#include <iomanip>
+#include <sstream>
+
 using namespace YACS::ENGINE;
 using namespace std;
 
@@ -83,7 +86,7 @@ void AnyInputPort::exRestoreInit()
 
 void AnyInputPort::put(Any *data)
 {
-  YACS::BASES::Lock lock(&_mutex);
+  YACS::BASES::AutoLocker<YACS::BASES::Mutex> lock(&_mutex);
   if(_value)
     _value->decrRef();
   _value=data;
@@ -105,7 +108,7 @@ void *AnyInputPort::get() const
 
 std::string AnyInputPort::getAsString()
 {
-  YACS::BASES::Lock lock(&_mutex);
+  YACS::BASES::AutoLocker<YACS::BASES::Mutex> lock(&_mutex);
   return getRuntime()->convertNeutralAsString(edGetType(),_value);
 }
 
@@ -130,7 +133,7 @@ std::string AnyInputPort::dump()
   switch (_value->getType()->kind())
     {
     case Double:
-      xmldump << "<value><double>" << _value->getDoubleValue() << "</double></value>" << endl;
+      xmldump << "<value><double>" << setprecision(16) << _value->getDoubleValue() << "</double></value>" << endl;
       break;
     case Int:
       xmldump << "<value><int>" << _value->getIntValue() << "</int></value>" << endl;