2 #ifndef _RUNTIMESALOME_HXX_
3 #define _RUNTIMESALOME_HXX_
6 #include <omniORB4/CORBA.h>
12 //--- from omniORBpy.h (not present on Debian Sarge packages)
15 PyObject* (*cxxObjRefToPyObjRef)(const CORBA::Object_ptr cxx_obj,
16 CORBA::Boolean hold_lock);
17 // Convert a C++ object reference to a Python object reference.
18 // If <hold_lock> is true, caller holds the Python interpreter lock.
20 CORBA::Object_ptr (*pyObjRefToCxxObjRef)(PyObject* py_obj,
21 CORBA::Boolean hold_lock);
22 // Convert a Python object reference to a C++ object reference.
23 // Raises BAD_PARAM if the Python object is not an object reference.
24 // If <hold_lock> is true, caller holds the Python interpreter lock.
26 PyObject* (*handleCxxSystemException)(const CORBA::SystemException& ex);
27 // Sets the Python exception state to reflect the given C++ system
28 // exception. Always returns NULL. The caller must hold the Python
31 //--- end of from omniORBpy.h (not present on Debian Sarge packages)
39 RuntimeSALOME* getSALOMERuntime();
46 class RuntimeSALOME: public Runtime
60 static void setRuntime(long flags = UsePython+UseCorba+UseXml+UseCpp+UseSalome); // singleton creation
62 friend RuntimeSALOME* getSALOMERuntime();
64 virtual void init(long flags);
67 virtual InputPort* createInputPort(const std::string& name,
68 const std::string& impl,
72 virtual OutputPort* createOutputPort(const std::string& name,
73 const std::string& impl,
76 virtual InputDataStreamPort* createInputDataStreamPort(const std::string& name,
77 Node *node,TypeCode *type);
79 virtual OutputDataStreamPort* createOutputDataStreamPort(const std::string& name,
80 Node *node,TypeCode *type);
82 virtual DataNode* createInDataNode(const std::string& kind,const std::string& name);
83 virtual DataNode* createOutDataNode(const std::string& kind,const std::string& name);
84 virtual InlineFuncNode* createFuncNode(const std::string& kind,const std::string& name);
85 virtual InlineNode* createScriptNode(const std::string& kind,const std::string& name);
87 virtual ServiceNode* createRefNode(const std::string& kind,const std::string& name);
88 virtual ServiceNode* createCompoNode(const std::string& kind,const std::string& name);
89 virtual ServiceInlineNode *createSInlineNode(const std::string& kind, const std::string& name);
90 virtual ComponentInstance* createComponentInstance(const std::string& name,
91 const std::string& kind="");
92 virtual Container *createContainer(const std::string& kind="");
93 virtual WhileLoop* createWhileLoop(const std::string& name);
94 virtual ForLoop* createForLoop(const std::string& name);
95 virtual Bloc* createBloc(const std::string& name);
96 virtual Proc* createProc(const std::string& name);
98 virtual InputPort* adapt(InputPort* source,
99 const std::string& impl,
100 TypeCode * type) throw (ConversionException);
102 virtual InputPort* adaptNeutral(InputPort* source,
103 const std::string& impl,
104 TypeCode * type) throw (ConversionException);
106 virtual InputPort* adapt(InputCorbaPort* source,
107 const std::string& impl,
108 TypeCode * type) throw (ConversionException);
110 virtual InputPort* adaptCorbaToCorba(InputCorbaPort* source,
111 TypeCode * type) throw (ConversionException);
113 virtual InputPort* adaptCorbaToNeutral(InputCorbaPort* source,
114 TypeCode * type) throw (ConversionException);
116 virtual InputPort* adaptCorbaToPython(InputCorbaPort* source,
117 TypeCode * type) throw (ConversionException);
119 virtual InputPort* adaptCorbaToCpp(InputCorbaPort* source,
120 TypeCode * type) throw (ConversionException);
122 virtual InputPort* adaptCorbaToXml(InputCorbaPort* source,
123 TypeCode * type) throw (ConversionException);
125 virtual InputPort* adapt(InputPyPort* source,
126 const std::string& impl,
127 TypeCode * type) throw (ConversionException);
129 virtual InputPort* adaptPythonToCorba(InputPyPort* source,
130 TypeCode * type) throw (ConversionException);
132 virtual InputPort* adaptPythonToNeutral(InputPyPort* source,
133 TypeCode * type) throw (ConversionException);
135 virtual InputPort* adaptPythonToPython(InputPyPort* source,
136 TypeCode * type) throw (ConversionException);
138 virtual InputPort* adaptPythonToXml(InputPyPort* source,
139 TypeCode * type) throw (ConversionException);
141 virtual InputPort* adaptPythonToCpp(InputPyPort* source,
142 TypeCode * type) throw (ConversionException);
144 virtual InputPort* adapt(InputCppPort* source,
145 const std::string& impl,
146 TypeCode * type) throw (ConversionException);
148 virtual InputPort* adaptCppToCorba(InputCppPort* source,
149 TypeCode * type) throw (ConversionException);
151 virtual InputPort* adaptCppToNeutral(InputCppPort* source,
152 TypeCode * type) throw (ConversionException);
154 virtual InputPort* adaptCppToPython(InputCppPort* source,
155 TypeCode * type) throw (ConversionException);
157 virtual InputPort* adaptCppToXml(InputCppPort* source,
158 TypeCode * type) throw (ConversionException);
160 virtual InputPort* adaptCppToCpp(InputCppPort* source,
161 TypeCode * type) throw (ConversionException);
163 virtual InputPort* adapt(InputXmlPort* source,
164 const std::string& impl,
165 TypeCode * type) throw (ConversionException);
167 virtual InputPort* adaptXmlToCorba(InputXmlPort* source,
168 TypeCode * type) throw (ConversionException);
170 virtual InputPort* adaptXmlToPython(InputXmlPort* inport,
171 TypeCode * type) throw (ConversionException);
173 virtual InputPort* adaptXmlToCpp(InputXmlPort* inport,
174 TypeCode * type) throw (ConversionException);
176 virtual InputPort* adaptXmlToNeutral(InputXmlPort* inport,
177 TypeCode * type) throw (ConversionException);
179 virtual InputPort* adaptNeutralToXml(InputPort* inport,
180 TypeCode * type) throw (ConversionException);
182 virtual InputPort* adaptNeutralToPython(InputPort* inport,
183 TypeCode * type) throw (ConversionException);
185 virtual InputPort* adaptNeutralToCorba(InputPort* inport,
186 TypeCode * type) throw (ConversionException);
188 virtual InputPort* adaptNeutralToCpp(InputPort* inport,
189 TypeCode * type) throw (ConversionException);
190 virtual ~RuntimeSALOME();
192 CORBA::ORB_ptr getOrb();
193 PyObject * getPyOrb();
194 PyObject * getBuiltins();
195 DynamicAny::DynAnyFactory_ptr getDynFactory();
196 omniORBpyAPI* getApi();
197 PyObject * get_omnipy();
200 RuntimeSALOME(); // singleton
201 RuntimeSALOME(long flags); // singleton
206 DynamicAny::DynAnyFactory_var _dynFactory;
210 bool _usePython, _useCorba, _useCpp, _useXml;