Salome HOME
Merge from V6_main_20120808 08Aug12
[modules/yacs.git] / src / engine / Runtime.hxx
index 9f6b9d4f2f9769b56cb42a9882865ff86dc78a56..34b608f6adf14acebc014f925abc196a2ebaa28e 100644 (file)
@@ -1,43 +1,48 @@
-//  Copyright (C) 2006-2008  CEA/DEN, EDF R&D
+// Copyright (C) 2006-2012  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
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
+// 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.
 //
-//  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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef _RUNTIME_HXX_
 #define _RUNTIME_HXX_
 
+#include "YACSlibEngineExport.hxx"
 #include "ConversionException.hxx"
 
 #include<string>
 #include<set>
 #include<map>
 #include<vector>
+#include<list>
 
 namespace YACS
 {
   namespace ENGINE
   {
     class Runtime;
-    Runtime* getRuntime() throw(Exception);
+    YACSLIBENGINE_EXPORT Runtime* getRuntime() throw(Exception);
 
     class Any;
     class InputPort;
     class OutputPort;
+    class InPropertyPort;
     class ForLoop;
     class ForEachLoop;
+    class OptimizerLoop;
     class WhileLoop;
     class Switch;
     class InlineNode;
@@ -52,12 +57,14 @@ namespace YACS
     class ElementaryNode;
     class Node;
     class TypeCode;
+    class TypeCodeStruct;
+    class TypeCodeObjref;
     class InputDataStreamPort;
     class OutputDataStreamPort;
     class Catalog;
     class CatalogLoader;
 
-    class Runtime
+    class YACSLIBENGINE_EXPORT Runtime
     {
       friend Runtime* getRuntime() throw(Exception);
     public:
@@ -82,8 +89,15 @@ namespace YACS
       virtual WhileLoop* createWhileLoop(const std::string& name);
       virtual ForLoop* createForLoop(const std::string& name);
       virtual ForEachLoop* createForEachLoop(const std::string& name,TypeCode * type);
+      virtual OptimizerLoop* createOptimizerLoop(const std::string& name,const std::string& algLib,
+                                                 const std::string& factoryName,bool algInitOnFile,
+                                                 const std::string& kind="", Proc * procForTypes = NULL);
       virtual Switch* createSwitch(const std::string& name);
 
+      virtual TypeCode * createInterfaceTc(const std::string& id, const std::string& name,
+                                            std::list<TypeCodeObjref *> ltc);
+      virtual TypeCode * createSequenceTc(const std::string& id, const std::string& name, TypeCode *content);
+      virtual TypeCodeStruct * createStructTc(const std::string& id, const std::string& name);
       
       virtual InputPort* createInputPort(const std::string& name,
                                          const std::string& impl,
@@ -105,6 +119,11 @@ namespace YACS
       virtual InputPort* adapt(InputPort* source, const std::string& impl, TypeCode * type,
                                bool init=false) throw (ConversionException) = 0;
 
+      virtual InputPort* adapt(InPropertyPort* source,
+                               const std::string& impl,
+                               TypeCode * type,
+                               bool init=false) throw (ConversionException) = 0;
+
       virtual void* convertNeutral(TypeCode * type, Any *data);
       virtual std::string convertNeutralAsString(TypeCode * type, Any *data);
 
@@ -117,6 +136,8 @@ namespace YACS
       static  YACS::ENGINE::TypeCode *_tc_bool;
       static  YACS::ENGINE::TypeCode *_tc_string;
       static  YACS::ENGINE::TypeCode *_tc_file;
+      static  YACS::ENGINE::TypeCode *_tc_stringpair;
+      static  YACS::ENGINE::TypeCode *_tc_propvec;
       virtual void setCatalogLoaderFactory(const std::string& name, CatalogLoader* factory);
       std::map<std::string,CatalogLoader*> _catalogLoaderFactoryMap;
       Catalog* getBuiltinCatalog();