1 // Copyright (C) 2006-2008 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #include "ConversionException.hxx"
34 Runtime* getRuntime() throw(Exception);
48 class ServiceInlineNode;
49 class ComponentInstance;
55 class InputDataStreamPort;
56 class OutputDataStreamPort;
62 friend Runtime* getRuntime() throw(Exception);
64 virtual void init() { }
65 virtual void fini() { }
67 virtual Catalog* loadCatalog(const std::string& sourceKind,const std::string& path);
68 virtual InlineFuncNode* createFuncNode(const std::string& kind,const std::string& name);
69 virtual InlineNode* createScriptNode(const std::string& kind,const std::string& name);
71 virtual ServiceNode* createRefNode(const std::string& kind,const std::string& name);
72 virtual ServiceNode* createCompoNode(const std::string& kind,const std::string& name);
73 virtual ServiceInlineNode *createSInlineNode(const std::string& kind, const std::string& name);
74 virtual DataNode* createInDataNode(const std::string& kind,const std::string& name);
75 virtual DataNode* createOutDataNode(const std::string& kind,const std::string& name);
77 virtual ComponentInstance* createComponentInstance(const std::string& name,
78 const std::string& kind="");
79 virtual Container *createContainer(const std::string& kind="");
80 virtual Proc* createProc(const std::string& name);
81 virtual Bloc* createBloc(const std::string& name);
82 virtual WhileLoop* createWhileLoop(const std::string& name);
83 virtual ForLoop* createForLoop(const std::string& name);
84 virtual ForEachLoop* createForEachLoop(const std::string& name,TypeCode * type);
85 virtual Switch* createSwitch(const std::string& name);
88 virtual InputPort* createInputPort(const std::string& name,
89 const std::string& impl,
93 virtual OutputPort* createOutputPort(const std::string& name,
94 const std::string& impl,
98 virtual InputDataStreamPort* createInputDataStreamPort(const std::string& name,
101 virtual OutputDataStreamPort* createOutputDataStreamPort(const std::string& name,
105 virtual InputPort* adapt(InputPort* source, const std::string& impl, TypeCode * type,
106 bool init=false) throw (ConversionException) = 0;
108 virtual void* convertNeutral(TypeCode * type, Any *data);
109 virtual std::string convertNeutralAsString(TypeCode * type, Any *data);
111 virtual void removeRuntime();
114 static const char RUNTIME_ENGINE_INTERACTION_IMPL_NAME[];
115 static YACS::ENGINE::TypeCode *_tc_double;
116 static YACS::ENGINE::TypeCode *_tc_int;
117 static YACS::ENGINE::TypeCode *_tc_bool;
118 static YACS::ENGINE::TypeCode *_tc_string;
119 static YACS::ENGINE::TypeCode *_tc_file;
120 virtual void setCatalogLoaderFactory(const std::string& name, CatalogLoader* factory);
121 std::map<std::string,CatalogLoader*> _catalogLoaderFactoryMap;
122 Catalog* getBuiltinCatalog();
123 virtual void addCatalog(Catalog* catalog);
124 virtual TypeCode* getTypeCode(const std::string& name);
127 static Runtime* _singleton;
129 std::set<std::string> _setOfImplementation;
130 Catalog* _builtinCatalog;
131 std::vector<Catalog*> _catalogs;