Salome HOME
outputports now hold qoi attribute
[modules/yacs.git] / src / evalyfx / YACSEvalPort.cxx
index 86cd5dfc1b4aef1df754b69292328dd71dd454a8..9dce3ae6bf09767f9dd4b6e982dcfc1d358d900c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2012-2015  CEA/DEN, EDF R&D
+// Copyright (C) 2012-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
@@ -15,7 +15,7 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-// 
+//
 // Author : Anthony Geay (EDF R&D)
 
 #include "YACSEvalPort.hxx"
@@ -66,6 +66,29 @@ YACSEvalAnyInt *YACSEvalAnyInt::deepCpy() const
   return new YACSEvalAnyInt(*this);
 }
 
+bool YACSEvalPort::IsInputPortPublishable(const YACS::ENGINE::InputPort *port)
+{
+  YACS::ENGINE::TypeCode *tc(port->edGetType());
+  if(!tc)
+    throw YACS::Exception("YACSEvalPort::IsInPortPublishable : null type code !");
+  if(tc->kind()==YACS::ENGINE::Double || tc->kind()==YACS::ENGINE::Int)
+    return true;
+  if(tc->kind()==YACS::ENGINE::String)
+    {
+      if(port->edIsManuallyInitialized())
+        return false;
+    }
+  return true;
+}
+
+bool YACSEvalPort::IsOutputPortPublishable(const YACS::ENGINE::OutputPort *port)
+{
+  YACS::ENGINE::TypeCode *tc(port->edGetType());
+  if(!tc)
+    throw YACS::Exception("YACSEvalPort::IsOutputPortPublishable : null type code !");
+  return tc->kind()==YACS::ENGINE::Double || tc->kind()==YACS::ENGINE::Int;
+}
+
 std::string YACSEvalPort::GetTypeOfData(const YACS::ENGINE::DataPort *port)
 {
   YACS::ENGINE::TypeCode *tc(port->edGetType());
@@ -100,6 +123,11 @@ bool YACSEvalInputPort::isOKForLock() const
   return hasDefaultValueDefined();
 }
 
+bool YACSEvalInputPort::isLocked() const
+{
+  return _isLocked;
+}
+
 bool YACSEvalInputPort::hasDefaultValueDefined() const
 {
   return _ptr->edIsManuallyInitialized();
@@ -310,7 +338,7 @@ void YACSEvalInputPort::checkForNonConstMethod() const
     throw YACS::Exception("YACSEvalInputPort::checkForNonConstMethod : trying to modify a locked input ! To release it call unlockAll on YACSEvalYFX instance owning this !");
 }
 
-YACSEvalOutputPort::YACSEvalOutputPort(YACS::ENGINE::OutputPort *ptr):_ptr(ptr)
+YACSEvalOutputPort::YACSEvalOutputPort(YACS::ENGINE::OutputPort *ptr):_ptr(ptr),_isQOfInt(false)
 {
   GetTypeOfData(_ptr);
 }