2 #ifndef _RUNTIMESALOME_HXX_
3 #define _RUNTIMESALOME_HXX_
6 #include "CORBAPorts.hxx"
7 #include "PythonPorts.hxx"
8 #include "XMLPorts.hxx"
9 #include "CORBAXMLConv.hxx"
19 //--- from omniORBpy.h (not present on Debian Sarge packages)
24 PyObject* (*cxxObjRefToPyObjRef)(const CORBA::Object_ptr cxx_obj,
25 CORBA::Boolean hold_lock);
26 // Convert a C++ object reference to a Python object reference.
27 // If <hold_lock> is true, caller holds the Python interpreter lock.
29 CORBA::Object_ptr (*pyObjRefToCxxObjRef)(PyObject* py_obj,
30 CORBA::Boolean hold_lock);
31 // Convert a Python object reference to a C++ object reference.
32 // Raises BAD_PARAM if the Python object is not an object reference.
33 // If <hold_lock> is true, caller holds the Python interpreter lock.
37 // Constructor for the singleton. Sets up the function pointers.
40 RuntimeSALOME* getSALOMERuntime();
42 class RuntimeSALOME: public Runtime
46 static void setRuntime(); // singleton creation
48 friend RuntimeSALOME* getSALOMERuntime();
53 virtual InputPort* createInputPort(const std::string& name,
54 const std::string& impl,
58 virtual OutputPort* createOutputPort(const std::string& name,
59 const std::string& impl,
63 virtual ElementaryNode* createNode(std::string implementation,
64 std::string name ) throw(Exception);
66 virtual InputPort* adapt(const std::string& imp_source,
68 const std::string& impl,
69 TypeCode * type) throw (ConversionException);
71 virtual InputPort* adapt(InputCorbaPort* source,
72 const std::string& impl,
73 TypeCode * type) throw (ConversionException);
75 virtual InputPort* adaptCorbaToCorba(InputCorbaPort* source,
76 TypeCode * type) throw (ConversionException);
78 virtual InputPort* adaptCorbaToPython(InputCorbaPort* source,
79 TypeCode * type) throw (ConversionException);
81 virtual InputPort* adaptCorbaToCpp(InputCorbaPort* source,
82 TypeCode * type) throw (ConversionException);
84 virtual InputPort* adaptCorbaToXml(InputCorbaPort* source,
85 TypeCode * type) throw (ConversionException);
87 virtual InputPort* adapt(InputPyPort* source,
88 const std::string& impl,
89 TypeCode * type) throw (ConversionException);
91 virtual InputPort* adaptPythonToCorba(InputPyPort* source,
92 TypeCode * type) throw (ConversionException);
94 virtual InputPort* adaptPythonToPython(InputPyPort* source,
95 TypeCode * type) throw (ConversionException);
97 virtual InputPort* adaptPythonToCpp(InputPyPort* source,
98 TypeCode * type) throw (ConversionException);
100 virtual InputPort* adapt(InputXmlPort* source,
101 const std::string& impl,
102 TypeCode * type) throw (ConversionException);
104 virtual InputPort* adaptXmlToCorba(InputXmlPort* source,
105 TypeCode * type) throw (ConversionException);
107 CORBA::ORB_ptr getOrb();
108 PyObject * getPyOrb();
109 PyObject * getBuiltins();
110 DynamicAny::DynAnyFactory_ptr getDynFactory();
111 omniORBpyAPI* getApi();
114 RuntimeSALOME(); // singleton
118 DynamicAny::DynAnyFactory_var _dynFactory;