]> SALOME platform Git repositories - modules/yacs.git/blob - src/engine/Runtime.hxx
Salome HOME
copy tag mergefrom_BR_V0_1_CC_Salome_04oct07
[modules/yacs.git] / src / engine / Runtime.hxx
1 #ifndef _RUNTIME_HXX_
2 #define _RUNTIME_HXX_
3
4 #include "ConversionException.hxx"
5
6 #include<string>
7 #include<set>
8 #include<map>
9
10 namespace YACS
11 {
12   namespace ENGINE
13   {
14     class Runtime;
15     
16     Runtime* getRuntime() throw(Exception); // singleton creation
17
18     class InputPort;
19     class OutputPort;
20     class ForLoop;
21     class ForEachLoop;
22     class WhileLoop;
23     class Switch;
24     class InlineNode;
25     class InlineFuncNode;
26     class ServiceNode;
27     class Container;
28     class ServiceInlineNode;
29     class ComponentInstance;
30     class Proc;
31     class Bloc;
32     class ElementaryNode;
33     class Node;
34     class TypeCode;
35     class InputDataStreamPort;
36     class OutputDataStreamPort;
37
38     class Runtime
39     {
40       friend Runtime* getRuntime() throw(Exception);
41     public:
42       virtual void init() { }
43       virtual void fini() { }
44
45       virtual InlineFuncNode* createFuncNode(const std::string& kind,const std::string& name);
46       virtual InlineNode* createScriptNode(const std::string& kind,const std::string& name);
47
48       virtual ServiceNode* createRefNode(const std::string& kind,const std::string& name);
49       virtual ServiceNode* createCompoNode(const std::string& kind,const std::string& name);
50       virtual ServiceInlineNode *createSInlineNode(const std::string& kind, const std::string& name);
51
52       virtual ComponentInstance* createComponentInstance(const std::string& name,
53                                                          const std::string& kind="");
54       virtual Container *createContainer(const std::string& kind="");
55       virtual Proc* createProc(const std::string& name);
56       virtual Bloc* createBloc(const std::string& name);
57       virtual WhileLoop* createWhileLoop(const std::string& name);
58       virtual ForLoop* createForLoop(const std::string& name);
59       virtual ForEachLoop* createForEachLoop(const std::string& name,TypeCode * type);
60       virtual Switch* createSwitch(const std::string& name);
61
62       
63       virtual InputPort* createInputPort(const std::string& name,
64                                          const std::string& impl,
65                                          Node * node,
66                                          TypeCode * type) = 0;
67
68       virtual OutputPort* createOutputPort(const std::string& name,
69                                            const std::string& impl,
70                                            Node * node,
71                                            TypeCode * type) = 0;
72
73       virtual InputDataStreamPort* createInputDataStreamPort(const std::string& name,
74                                                              Node * node,
75                                                              TypeCode * type);
76       virtual OutputDataStreamPort* createOutputDataStreamPort(const std::string& name,
77                                                                Node * node,
78                                                                TypeCode * type);
79
80       virtual InputPort* adapt(InputPort* source, const std::string& impl, TypeCode * type) throw (ConversionException) = 0;
81
82       virtual ~Runtime();
83     public:
84       static const char RUNTIME_ENGINE_INTERACTION_IMPL_NAME[];
85       static  YACS::ENGINE::TypeCode *_tc_double;
86       static  YACS::ENGINE::TypeCode *_tc_int;
87       static  YACS::ENGINE::TypeCode *_tc_bool;
88       static  YACS::ENGINE::TypeCode *_tc_string;
89       static  YACS::ENGINE::TypeCode *_tc_file;
90     protected:
91       static Runtime* _singleton;
92       Runtime() { }
93       std::set<std::string> _setOfImplementation;
94
95     };
96   }
97 }
98 #endif