]> SALOME platform Git repositories - modules/yacs.git/blobdiff - src/engine/Test/RuntimeForEngineIntegrationTest.cxx
Salome HOME
Updated copyright comment
[modules/yacs.git] / src / engine / Test / RuntimeForEngineIntegrationTest.cxx
index 8750ad6686d63c436c02da118e8248c15b346757..0ef037a72a173be5c9a0e5e672d9ba8c783f926e 100644 (file)
@@ -1,10 +1,31 @@
+// 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
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
 #include "RuntimeForEngineIntegrationTest.hxx"
 #include "ComponentInstanceTest.hxx"
+#include "Exception.hxx"
 #include "ToyNode.hxx"
 #include "TypeCode.hxx"
 #include <sstream>
+#include <string.h>
+
 
-using namespace std;
 using namespace YACS::ENGINE;
 
 void RuntimeForEngineIntegrationTest::setRuntime()
@@ -13,17 +34,22 @@ void RuntimeForEngineIntegrationTest::setRuntime()
     Runtime::_singleton = new RuntimeForEngineIntegrationTest;
 }
 
-ElementaryNode* RuntimeForEngineIntegrationTest::createNode(const string& implementation, const string& name) throw(Exception)
+std::vector< std::pair<std::string,int> > RuntimeForEngineIntegrationTest::getCatalogOfComputeNodes() const
+{
+  return std::vector< std::pair<std::string,int> >();
+}
+
+ElementaryNode* RuntimeForEngineIntegrationTest::createNode(const std::string& implementation, const std::string& name)
 {
   if (implementation == ToyNode::MY_IMPL_NAME)
     return new ToyNode(name);
   else if(implementation == LimitNode::MY_IMPL_NAME)
     return new LimitNode(name);
-  string what="RuntimeForEngineIntegrationTest does not handle this implementation: " + implementation;
-  throw Exception(what);
+  std::string what="RuntimeForEngineIntegrationTest does not handle this implementation: " + implementation;
+  throw YACS::Exception(what);
 }
 
-InputPort* RuntimeForEngineIntegrationTest::createInputPort(const string& name, const string& impl, Node * node, TypeCode * type)
+InputPort* RuntimeForEngineIntegrationTest::createInputPort(const std::string& name, const std::string& impl, Node * node, TypeCode * type)
 {
   if(impl == ToyNode::MY_IMPL_NAME)
     {
@@ -33,12 +59,12 @@ InputPort* RuntimeForEngineIntegrationTest::createInputPort(const string& name,
     }
   else if(impl == LimitNode::MY_IMPL_NAME)
     throw Exception("InputPort creation not allowed for LimitNode");
-  ostringstream msg;
+  std::ostringstream msg;
   msg << "Cannot create " << impl << " OutputPort" ;
-  throw Exception(msg.str());
+  throw YACS::Exception(msg.str());
 }
 
-OutputPort* RuntimeForEngineIntegrationTest::createOutputPort(const string& name, const string& impl, Node * node, TypeCode * type)
+OutputPort* RuntimeForEngineIntegrationTest::createOutputPort(const std::string& name, const std::string& impl, Node * node, TypeCode * type)
 {
   if(impl == ToyNode::MY_IMPL_NAME)
     {
@@ -48,16 +74,21 @@ OutputPort* RuntimeForEngineIntegrationTest::createOutputPort(const string& name
     }
   else if(impl == LimitNode::MY_IMPL_NAME)
     throw Exception("OutputPort creation not allowed for LimitNode");
-  stringstream msg;
+  std::stringstream msg;
   msg << "Cannot create " << impl << " OutputPort" ;
   throw Exception(msg.str());
 }
 
-InputPort* RuntimeForEngineIntegrationTest::adapt(InputPort* source, const string& impl,TypeCode * type) throw (ConversionException)
+InputPort* RuntimeForEngineIntegrationTest::adapt(InputPort* source, const std::string& impl,TypeCode * type,bool init)
 {
   return new ProxyPort(source);
 }
 
+InputPort* RuntimeForEngineIntegrationTest::adapt(InPropertyPort* source, const std::string& impl, TypeCode * type, bool init)
+{
+  return adapt((InputPort *)source, impl, type, init);
+}
+
 ComponentInstance* RuntimeForEngineIntegrationTest::createComponentInstance(const std::string& name, const std::string& kind)
 {
   if(kind==ToyNode1S::KIND)
@@ -66,7 +97,7 @@ ComponentInstance* RuntimeForEngineIntegrationTest::createComponentInstance(cons
     return new ComponentInstanceTest2(name);
   else
     {
-      string msg("RuntimeForEngineIntegrationTest::createComponentInstance : Unable to crate component with kind \"");
+      std::string msg("RuntimeForEngineIntegrationTest::createComponentInstance : Unable to crate component with kind \"");
       msg+=kind; msg+="\"";
       throw Exception(msg);
     }