24#define protected public
25#include <omniORB4/CORBA.h>
26#include <omniORB4/internal/typecode.h>
27#include <omniORB4/internal/corbaOrb.h>
31#include "YACS_version.h"
62#include "PythonCppUtils.hxx"
115#include "SALOME_LifeCycleCORBA.hxx"
116#include "SALOME_ResourcesManager.hxx"
117#include "SALOME_ContainerManager.hxx"
118#include "SALOMEconfig.h"
119#include "SALOME_Embedded_NamingService.hxx"
120#include CORBA_CLIENT_HEADER(SALOME_ContainerManager)
124#include <libxml/parser.h>
125#include <omniORB4/CORBA.h>
138std::unique_ptr<SALOME_NamingService_Container_Abstract> RuntimeSALOME::getNS()
152 DEBTRACE(
"RuntimeSALOME::setRuntime() done !");
177 nodeMap[
"PyFunction"]=
new PyFuncNode(
"PyFunction");
178 nodeMap[
"PyScript"]=
new PythonNode(
"PyScript");
179 nodeMap[
"CORBANode"]=
new CORBANode(
"CORBANode");
180 nodeMap[
"XmlNode"]=
new XmlNode(
"XmlNode");
181 nodeMap[
"SalomeNode"]=
new SalomeNode(
"SalomeNode");
182 nodeMap[
"CppNode"]=
new CppNode(
"CppNode");
184 nodeMap[
"PresetNode"]=
new PresetNode(
"PresetNode");
185 nodeMap[
"OutNode"]=
new OutNode(
"OutNode");
186 nodeMap[
"StudyInNode"]=
new StudyInNode(
"StudyInNode");
187 nodeMap[
"StudyOutNode"]=
new StudyOutNode(
"StudyOutNode");
193 typeMap[
"seqdblevec"]=
createSequenceTc(
"seqdblevec",
"seqdblevec",typeMap[
"dblevec"]);
194 typeMap[
"seqintvec"]=
createSequenceTc(
"seqintvec",
"seqintvec",typeMap[
"intvec"]);
195 typeMap[
"seqstringvec"]=
createSequenceTc(
"seqstringvec",
"seqstringvec",typeMap[
"stringvec"]);
196 typeMap[
"seqboolvec"]=
createSequenceTc(
"seqboolvec",
"seqboolvec",typeMap[
"boolvec"]);
197 std::list<TypeCodeObjref *> ltc;
199 typeMap[
"seqpyobj"]=
createSequenceTc(
"seqpyobj",
"seqpyobj",typeMap[
"pyobj"]);
208 composednodeMap[
"ForEachLoop_pyobj"]=
createForEachLoop(
"ForEachLoop_pyobj",typeMap[
"pyobj"]);;
211 typeMap[
"dataref"]=
t;
241 init(flags, argc, argv);
246 DEBTRACE(
"RuntimeSALOME::~RuntimeSALOME");
248 std::map<std::string, CatalogLoader*>::const_iterator pt;
259 const char * SCRIPT =
"from salome_kernel import list_of_catalogs_regarding_environement\n"
260"import KernelModuleCatalog\n"
261"KernelModuleCatalog.myModuleCatalog( list_of_catalogs_regarding_environement() )\n";
262 PyRun_SimpleString(SCRIPT);
285 PortableServer::POA_var root_poa;
286 PortableServer::POAManager_var pman;
287 CORBA::Object_var obj;
288 int nbargs = 0;
char **
args = 0;
289 _orb = CORBA::ORB_init (nbargs,
args);
290 obj =
_orb->resolve_initial_references(
"RootPOA");
291 root_poa = PortableServer::POA::_narrow(obj);
292 pman = root_poa->the_POAManager();
296 DEBTRACE(
"_orb refCount: " << ((omniOrbORB*)
_orb.in())->pd_refCount);
298 obj =
_orb->resolve_initial_references(
"DynAnyFactory");
299 _dynFactory = DynamicAny::DynAnyFactory::_narrow(obj);
304 DEBTRACE(
"RuntimeSALOME::init, is python extension = " << ispyext);
307 if (!Py_IsInitialized())
309#if PY_VERSION_HEX < 0x02040000
314 if (argc > 0 && argv != NULL)
316 wchar_t **changed_argv =
new wchar_t*[argc];
317 for (
int i = 0;
i < argc;
i++)
321 PySys_SetArgv(argc, changed_argv);
327 char defaultName[] =
"SALOME_YACS_RUNTIME";
328 wchar_t **changed_pyArgv =
new wchar_t*[pyArgc];
329 pyArgv[0] = defaultName;
330 for (
int i = 0;
i < pyArgc;
i++)
334 PySys_SetArgv(pyArgc, changed_pyArgv);
336#if PY_VERSION_HEX < 0x03070000
337 PyEval_InitThreads();
343 PyObject *mainmod,*pyapi,*res ;
345 PyGILState_STATE gstate;
346 gstate = PyGILState_Ensure();
348 mainmod = PyImport_AddModule(
"__main__");
349 globals = PyModule_GetDict(mainmod);
352 if (PyDict_GetItemString(globals,
"__builtins__") == NULL)
354 PyObject *bimod = PyImport_ImportModule(
"builtins");
355 if (bimod == NULL || PyDict_SetItemString(globals,
"__builtins__", bimod) != 0)
356 Py_FatalError(
"can't add __builtins__ to __main__");
360 _bltins = PyEval_GetBuiltins();
366 _omnipy = PyImport_ImportModule((
char*)
"_omnipy");
370 PyErr_SetString(PyExc_ImportError, (
char*)
"Cannot import _omnipy");
373 pyapi = PyObject_GetAttrString(
_omnipy, (
char*)
"API");
378 _api = (omniORBpyAPI*)PyCapsule_GetPointer(pyapi,
"_omnipy.API");
381 res=PyRun_String(
"\n"
382 "from math import *\n"
384 "sys.path.insert(0,'.')\n"
385 "from omniORB import CORBA\n"
386 "from omniORB import any\n"
387 "orb = CORBA.ORB_init([], CORBA.ORB_ID)\n"
388 "#print(sys.getrefcount(orb))\n"
394 Py_file_input,globals,globals );
402 _pyorb = PyDict_GetItemString(globals,
"orb");
406 pyany = PyDict_GetItemString(globals,
"any");
410 DEBTRACE(
"_orb refCount: " << ((omniOrbORB*)
_orb.in())->pd_refCount);
414 PyGILState_Release(gstate);
427 PyGILState_STATE gstate = PyGILState_Ensure();
429 DEBTRACE(
"_orb refCount: " << ((omniOrbORB*)
_orb.in())->pd_refCount);
431 PyObject *mainmod, *globals;
432 mainmod = PyImport_AddModule(
"__main__");
433 globals = PyModule_GetDict(mainmod);
437 res=PyRun_String(
"orb.destroy()\n"
439 Py_file_input,globals,globals );
446 delete nodeMap[
"PyFunction"];
447 delete nodeMap[
"PyScript"];
448 delete nodeMap[
"SalomePythonNode"];
449 nodeMap.erase(
"PyFunction");
450 nodeMap.erase(
"PyScript");
451 nodeMap.erase(
"SalomePythonNode");
453 if( isFinalizingPython )
456 DEBTRACE(
"_orb refCount: " << ((omniOrbORB*)
_orb.in())->pd_refCount);
464 DEBTRACE(
"_orb refCount: " << ((omniOrbORB*)
_orb.in())->pd_refCount);
473 std::ostringstream oss; oss <<
"from subprocess import Popen" << std::endl;
474 oss <<
"p = Popen([";
475 for(
auto i = 0 ;
i < cmds.size() ; ++
i)
477 oss <<
" " <<
"\"" << cmds[
i] <<
"\"";
478 if(
i < cmds.size()-1)
485 AutoPyRef context = PyDict_New();
486 PyDict_SetItemString( context,
"__builtins__",
getBuiltins() );
487 std::string errorDetails;
494 std::cerr << e.
what() << std::endl << errorDetails << std::endl;
497 PyObject *ret = PyDict_GetItemString(context,
"p");
511 catch(SALOME_Exception& e)
513 throw Exception(
"RuntimeSALOME::getCatalogOfComputeNodes : Unable to contact the SALOME Naming Service");
515 CORBA::Object_var obj(namingService.
Resolve(SALOME_ResourcesManager::_ResourcesManagerNameInNS));
516 if(CORBA::is_nil(obj))
517 throw Exception(
"RuntimeSALOME::getCatalogOfComputeNodes : Unable to access to the resource manager !");
518 Engines::ResourcesManager_var resManager(Engines::ResourcesManager::_narrow(obj));
519 if(CORBA::is_nil(resManager))
520 throw Exception(
"RuntimeSALOME::getCatalogOfComputeNodes : Internal error ! The entry attached to the res manager in NS does not have right type !");
521 std::vector< std::pair<std::string,int> > ret;
522 Engines::ResourceParameters params;
524 params.hostname =
"";
528 params.cpu_clock = 0;
530 params.nb_proc_per_node = 0;
532 params.can_launch_batch_jobs =
false;
533 params.can_run_containers =
true;
534 params.componentList.length(0);
537 Engines::ResourceList_var resourceList;
538 resourceList = resManager->GetFittingResources(params);
539 ret.reserve(resourceList->length());
540 for(
int i = 0;
i<resourceList->length();
i++)
542 const char* resource_name = resourceList[
i];
543 std::string std_resource_name = resource_name;
544 Engines::ResourceDefinition_var resource_definition
545 = resManager->GetResourceDefinition(resource_name);
546 int nb_cores = resource_definition->nb_node *
547 resource_definition->nb_proc_per_node;
548 ret.push_back(std::pair<std::string,int>(resource_name, nb_cores));
551 catch(SALOME::SALOME_Exception& e)
554 message=e.details.text.in();
563#ifdef YACS_DEVELOPMENT
564 return CORBA::string_dup(YACS_VERSION_STR
"dev");
566 return CORBA::string_dup(YACS_VERSION_STR);
576 std::list<TypeCodeObjref *> ltc)
579 if(
id ==
"") myName =
"IDL:" + name +
":1.0";
585 const std::string& name,
594 if(
id ==
"") myName =
"IDL:" + name +
":1.0";
601 return new Bloc(name);
615 bool algInitOnFile,
const std::string& kind,
Proc * procForTypes)
631 else if(kind ==
"study" )
635 std::string msg=
"DataNode kind ("+kind+
") unknown";
645 else if(kind ==
"study" )
650 std::string msg=
"OutDataNode kind ("+kind+
") unknown";
664 std::string msg=
"FuncNode kind ("+kind+
") unknown";
676 std::string msg=
"ScriptNode kind ("+kind+
") unknown";
693 std::string msg=
"RefNode kind ("+kind+
") unknown";
710 std::string msg=
"CompoNode kind ("+kind+
") unknown";
718 std::string msg=
"CompoNode kind ("+kind+
") unknown";
723 const std::string& kind)
736 std::string msg=
"Component Instance kind ("+kind+
") unknown";
748 std::string msg=
"Container kind ("+kind+
") unknown";
753 const std::string& impl,
776 msg <<
"Cannot create " << impl <<
" InputPort" ;
777 msg <<
" (" << __FILE__ <<
":" << __LINE__ <<
")";
783 const std::string& impl,
806 msg <<
"Cannot create " << impl <<
" OutputPort" ;
807 msg <<
" (" << __FILE__ <<
":" << __LINE__ <<
")";
850 const std::string& impl,
877 msg <<
"Cannot adapt " << imp_source <<
" InputPort to " << impl;
878 msg <<
" (" << __FILE__ <<
":" << __LINE__ <<
")";
893 const std::string& impl,
916 msg <<
"Cannot connect Corba output port with type: " << type->
id() ;
917 msg <<
" to Neutral input port " << inport->
getName() <<
" with type: " << inport->
edGetType()->
id();
919 msg <<
" ("<<__FILE__ <<
":" << __LINE__<<
")";
946 msg <<
"Cannot connect Python output port with type: " << type->
id() ;
947 msg <<
" to Neutral input port " << inport->
getName() <<
" with type: " << inport->
edGetType()->
id();
949 msg <<
" ("<<__FILE__ <<
":" << __LINE__<<
")";
971 msg <<
"Cannot connect Xml output port with type: " << type->
id() ;
972 msg <<
" to Neutral input port " << inport->
getName() <<
" with type: " << inport->
edGetType()->
id();
974 msg <<
" ("<<__FILE__ <<
":" << __LINE__<<
")";
988 DEBTRACE(
"RuntimeSALOME::adaptNeutralToCpp(InputPort* inport" );
996 msg <<
"Cannot connect Cpp output port with type: " << type->
id() ;
997 msg <<
" to Neutral input port " << inport->
getName() <<
" with type: " << inport->
edGetType()->
id();
999 msg <<
" ("<<__FILE__ <<
":" << __LINE__<<
")";
1013 const std::string& impl,
1040 msg <<
"Cannot connect InputPort : unknown implementation " << impl;
1041 msg <<
" (" <<__FILE__ <<
":" <<__LINE__ <<
")";
1062 msg <<
"Cannot connect Corba output port with type: " << type->
id() ;
1063 msg <<
" to Xml input port " << inport->
getName() <<
" with type: " << inport->
edGetType()->
id();
1065 msg <<
" ("<<__FILE__ <<
":" << __LINE__<<
")";
1082 return new PyXml(inport);
1086 msg <<
"Cannot connect Python output port with type: " << type->
id() ;
1087 msg <<
" to Xml input port " << inport->
getName() <<
" with type: " << inport->
edGetType()->
id();
1089 msg <<
" ("<<__FILE__ <<
":" << __LINE__<<
")";
1103 DEBTRACE(
"RuntimeSALOME::adaptXmlToCpp(InputPort* inport" );
1108 return new CppXml(inport);
1112 msg <<
"Cannot connect Cpp output port with type: " << type->
id() ;
1113 msg <<
" to Xml input port " << inport->
getName() <<
" with type: " << inport->
edGetType()->
id();
1115 msg <<
" ("<<__FILE__ <<
":" << __LINE__<<
")";
1136 msg <<
"Cannot connect Xml InputPort to OutputNeutralPort : " ;
1137 msg <<
"(" <<__FILE__ <<
":" <<__LINE__<<
")";
1158 msg <<
"Cannot connect Xml output port with type: " << type->
id() ;
1159 msg <<
" to Xml input port " << inport->
getName() <<
" with type: " << inport->
edGetType()->
id();
1161 msg <<
" ("<<__FILE__ <<
":" << __LINE__<<
")";
1176 const std::string& impl,
1202 msg <<
"Cannot connect InputXmlPort to " << impl <<
" implementation";
1203 msg <<
" (" << __FILE__ <<
":" << __LINE__ <<
")";
1232 msg <<
"Cannot connect Corba output port with type: " << type->
id() ;
1233 msg <<
" to CORBA input port " << inport->
getName() <<
" with type: " << inport->
edGetType()->
id();
1235 msg <<
" ("<<__FILE__ <<
":" << __LINE__<<
")";
1275 msg <<
"Cannot connect Python output port with type: " << type->
id() ;
1276 msg <<
" to CORBA input port " << inport->
getName() <<
" with incompatible objref type: " << inport->
edGetType()->
id();
1277 msg <<
" (" << __FILE__ <<
":" <<__LINE__ <<
")";
1290 msg <<
"Cannot convert this sequence type " ;
1291 msg << __FILE__ <<
":" <<__LINE__;
1304 msg <<
"Cannot convert this struct type " << type->
id() <<
" to " << inport->
edGetType()->
id();
1305 msg << __FILE__ <<
":" <<__LINE__;
1311 msg <<
"Cannot connect Python output port with type: " << type->
id() ;
1312 msg <<
" to CORBA input port " << inport->
getName() <<
" with type: " << inport->
edGetType()->
id();
1314 msg <<
" ("<<__FILE__ <<
":" << __LINE__<<
")";
1337 msg <<
"Cannot connect Xml output port with type: " << type->
id() ;
1338 msg <<
" to Corba input port " << inport->
getName() <<
" with type: " << inport->
edGetType()->
id();
1340 msg <<
" ("<<__FILE__ <<
":" << __LINE__<<
")";
1355 DEBTRACE(
"RuntimeSALOME::adaptCorbaToCpp(InputCorbaPort* inport" );
1363 msg <<
"Cannot connect Cpp output port with type: " << type->
id() ;
1364 msg <<
" to Corba input port " << inport->
getName() <<
" with type: " << inport->
edGetType()->
id();
1366 msg <<
" ("<<__FILE__ <<
":" << __LINE__<<
")";
1408 msg <<
"Cannot convert this sequence type " ;
1409 msg << __FILE__ <<
":" <<__LINE__;
1420 msg <<
"Cannot connect Neutral output port with type: " << type->
id() ;
1421 msg <<
" to Corba input port " << inport->
getName() <<
" with type: " << inport->
edGetType()->
id();
1423 msg <<
" ("<<__FILE__ <<
":" << __LINE__<<
")";
1438 const std::string& impl,
1467 msg <<
"Cannot connect InputCorbaPort : unknown implementation " ;
1468 msg << __FILE__ <<
":" <<__LINE__;
1487 return new PyInit(inport);
1498 msg <<
"Cannot connect Python output port with type: " << type->
id() ;
1499 msg <<
" to Python input port " << inport->
getName() <<
" with type: " << inport->
edGetType()->
id();
1501 msg <<
" ("<<__FILE__ <<
":" << __LINE__<<
")";
1516 DEBTRACE(
"RuntimeSALOME::adaptPythonToCpp(InputPyPort* inport" );
1520 return new CppPy(inport);
1524 msg <<
"Cannot connect Cpp output port with type: " << type->
id() ;
1525 msg <<
" to Python input port " << inport->
getName() <<
" with type: " << inport->
edGetType()->
id();
1527 msg <<
" ("<<__FILE__ <<
":" << __LINE__<<
")";
1569 msg <<
"Cannot convert this sequence type " ;
1570 msg << __FILE__ <<
":" <<__LINE__;
1581 msg <<
"Cannot connect Neutral output port with type: " << type->
id() ;
1582 msg <<
" to Python input port " << inport->
getName() <<
" with type: " << inport->
edGetType()->
id();
1584 msg <<
" ("<<__FILE__ <<
":" << __LINE__<<
")";
1625 msg <<
"Cannot connect InputCorbaPort : incompatible objref types " << type->
id() <<
" " << inport->
edGetType()->
id();
1626 msg <<
" " << __FILE__ <<
":" <<__LINE__;
1639 msg <<
"Cannot convert this sequence type " ;
1640 msg << __FILE__ <<
":" <<__LINE__;
1653 msg <<
"Cannot convert this struct type " << type->
id() <<
" to " << inport->
edGetType()->
id();
1654 msg <<
" " << __FILE__ <<
":" <<__LINE__;
1660 msg <<
"Cannot connect Corba output port with type: " << type->
id() ;
1661 msg <<
" to Python input port " << inport->
getName() <<
" with type: " << inport->
edGetType()->
id();
1663 msg <<
" ("__FILE__ <<
":" << __LINE__ <<
")";
1686 msg <<
"Cannot connect Xml output port with type: " << type->
id() ;
1687 msg <<
" to Python input port " << inport->
getName() <<
" with type: " << inport->
edGetType()->
id();
1689 msg <<
" ("<<__FILE__ <<
":" << __LINE__<<
")";
1704 const std::string& impl,
1730 msg <<
"Cannot connect InputPyPort : unknown implementation " << impl;
1731 msg <<
" ("<<__FILE__ <<
":" << __LINE__<<
")";
1747 DEBTRACE(
"RuntimeSALOME::adaptCppToCorba(InputCppPort* inport)");
1755 msg <<
"Cannot connect Corba output port with type: " << type->
id() ;
1756 msg <<
" to Cpp input port " << inport->
getName() <<
" with type: " << inport->
edGetType()->
id();
1758 msg <<
" ("<<__FILE__ <<
":" << __LINE__<<
")";
1772 DEBTRACE(
"RuntimeSALOME::adaptCppToPython(InputCppPort* inport)");
1776 return new PyCpp(inport);
1780 msg <<
"Cannot connect Python output port with type: " << type->
id() ;
1781 msg <<
" to Cpp input port " << inport->
getName() <<
" with type: " << inport->
edGetType()->
id();
1783 msg <<
" ("<<__FILE__ <<
":" << __LINE__<<
")";
1797 DEBTRACE(
"RuntimeSALOME::adaptCppToCpp(InputPort* inport" );
1802 return new CppCpp(inport);
1806 msg <<
"Cannot connect Cpp output port with type: " << type->
id() ;
1807 msg <<
" to Cpp input port " << inport->
getName() <<
" with type: " << inport->
edGetType()->
id();
1809 msg <<
" ("<<__FILE__ <<
":" << __LINE__<<
")";
1823 DEBTRACE(
"RuntimeSALOME::adaptCppToNeutral(InputPort* inport" );
1832 msg <<
"Cannot connect Neutral output port with type: " << type->
id() ;
1833 msg <<
" to Cpp input port " << inport->
getName() <<
" with type: " << inport->
edGetType()->
id();
1835 msg <<
" ("<<__FILE__ <<
":" << __LINE__<<
")";
1843 DEBTRACE(
"RuntimeSALOME::adaptCppToXml(InputCppPort* inport" );
1847 return new XmlCpp(inport);
1851 msg <<
"Cannot connect Xml output port with type: " << type->
id() ;
1852 msg <<
" to Cpp input port " << inport->
getName() <<
" with type: " << inport->
edGetType()->
id();
1854 msg <<
" ("<<__FILE__ <<
":" << __LINE__<<
")";
1869 const std::string& impl,
1872 DEBTRACE(
"RuntimeSALOME::adapt(InputCppPort* source)");
1896 msg <<
"Cannot connect InputCppPort to " << impl <<
" implementation";
1897 msg <<
" (" << __FILE__ <<
":" << __LINE__ <<
")";
1922 CORBA::Object_var ret;
1923 std::string entryCpp(entry);
1924 if(entryCpp.substr(0,4) ==
"IOR:")
1926 ret =
_orb->string_to_object( entry );
1930 auto pos = entryCpp.find_last_of(
'/');
1931 std::string entry1( entryCpp.substr(pos+1,std::string::npos) );
1932 pos = entry1.find_last_of(
'.');
1933 std::string entry2( entry1.substr(0,pos) );
1934 Engines::EmbeddedNamingService_var ns = GetEmbeddedNamingService();
1935 std::unique_ptr<Engines::IORType> iorRet( ns->Resolve( entry2.c_str() ) );
1936 auto len = iorRet->length();
1937 std::unique_ptr<char[]> iorTrans(
new char[len+1]); iorTrans[len] =
'\0';
1938 for(
auto i = 0 ;
i < len ; ++
i) iorTrans[
i] = (*iorRet)[
i];
1939 ret =
_orb->string_to_object(iorTrans.get());
1976 return (
void *)Py_None;
1988 PyGILState_STATE gstate = PyGILState_Ensure();
1999 PyGILState_Release(gstate);
2018 PyGILState_STATE gstate = PyGILState_Ensure();
2019 mainmod = PyImport_AddModule(
"__main__");
2020 globals = PyModule_GetDict(mainmod);
2021 PyObject* d = PyDict_New();
2023 ob= PyRun_String( s.c_str(), Py_eval_input, globals, d);
2030 PySys_SetObject((
char *)
"stderr", new_stderr);
2032 PySys_SetObject((
char *)
"stderr", PySys_GetObject((
char *)
"__stderr__"));
2033 Py_DECREF(new_stderr);
2034 PyGILState_Release(gstate);
2037 PyGILState_Release(gstate);
static wchar_t * Py_DecodeLocale(const char *arg, size_t *size)
#define YASSERT(val)
YASSERT macro is always defined, used like assert, but throw a YACS::Exception instead of abort.
void init_orb(CORBA::ORB_ptr orb=0) override
CORBA::Object_ptr Resolve(const char *Path) override
: Interface for management of storage of data formated dynamically in its TypeCode....
Composed node to group elementary and composed nodes.
Class for CORBA component instance.
Class for CORBA Service Node.
static const char IMPL_NAME[]
std::map< std::string, ComposedNode * > _composednodeMap
std::map< std::string, ComponentDefinition * > _componentMap
std::map< std::string, Node * > _nodeMap
std::map< std::string, TypeCode * > _typeMap
Base class for all component instances.
Class for conversion from CORBA Output port to CORBA Input port.
Class for conversion from CORBA Output port to Python Input port.
Class for conversion from CORBA Output port to Python Input port.
Class for conversion from CORBA Output port to Python Input port.
Class for conversion from CORBA Output port to Python Input port.
Class for conversion from CORBA Output port to Python Input port.
Class for conversion from CORBA Output port to Python Input port.
Class for conversion of struct objects from CORBA Output port to Python Input port.
Class for conversion from C++ Output port to C++ Input port.
Class for C++ Nodes (in process component)
static const char IMPL_NAME[]
Class for data parameters specification.
TypeCode * edGetType() const
std::string getName() const
InputPort * edGetNbOfBranchesPort()
class for Input Property Ports
Class for calculation node (function) inlined (and executed) in the schema.
Class for calculation node (script) inlined (and executed) in the schema.
Class for conversion from Neutral Output port to Xml Input port.
Class for initialization of a Neutral port with YACS::ENGINE::Any* object.
Class for conversion from Neutral Output port to XML Input port.
Base class for all nodes.
std::string getImplementation() const
class to build optimization loops
Class for Output Calcium DataStream Ports.
Class for XML Output Ports.
Base class for all schema objects.
Base class for Proxy Input Ports.
static void ExecuteLocalInternal(const std::string &codeStr, PyObject *context, std::string &errorDetails)
static const char IMPL_NAME[]
CORBA::Object_var getFromNS(const char *entry) const
virtual WhileLoop * createWhileLoop(const std::string &name)
virtual TypeCodeStruct * createStructTc(const std::string &id, const std::string &name)
DynamicAny::DynAnyFactory_var _dynFactory
static void setRuntime(long flags=UsePython+UseCorba+UseXml+UseCpp+UseSalome, int argc=0, char *argv[]=NULL)
static Runtime * getSingleton()
virtual InlineNode * createScriptNode(const std::string &kind, const std::string &name)
virtual InputDataStreamPort * createInputDataStreamPort(const std::string &name, Node *node, TypeCode *type)
virtual std::string convertNeutralAsString(TypeCode *type, Any *data)
Convert a YACS::ENGINE::Any object to a string to be used in GUI for example.
virtual InputPort * adaptNeutralToXml(InputPort *inport, TypeCode *type)
Adapt a Neutral input port to a Xml output port.
virtual InputPort * adaptNeutralToCorba(InputPort *inport, TypeCode *type)
Adapt a Neutral input port to a Corba output port.
virtual InputPort * adaptPythonToPython(InputPyPort *source, TypeCode *type, bool init)
Adapt a Python input port to a Python output port.
virtual InputPort * createInputPort(const std::string &name, const std::string &impl, Node *node, TypeCode *type)
virtual TypeCode * createSequenceTc(const std::string &id, const std::string &name, TypeCode *content)
virtual Container * createContainer(const std::string &kind="")
virtual InputPort * adaptCppToCpp(InputCppPort *source, TypeCode *type)
Adapt a C++ input port to a C++ output port.
virtual InputPort * adaptXmlToXml(InputXmlPort *inport, TypeCode *type, bool init)
Adapt a XML input port to a Xml output port.
virtual Proc * createProc(const std::string &name)
virtual void * convertNeutral(TypeCode *type, Any *data)
Convert a YACS::ENGINE::Any object to an external object with type type.
virtual InputPort * adaptCorbaToXml(InputCorbaPort *source, TypeCode *type)
Adapt a CORBA input port to connect it to a XML output port.
virtual PyObject * convertStringToPyObject(const std::string &s)
virtual InputPort * adaptPythonToCorba(InputPyPort *source, TypeCode *type)
Adapt a Python input port to a Corba output port.
virtual InputPort * adaptCppToCorba(InputCppPort *source, TypeCode *type)
Adapt a C++ input port to connect it to a CORBA output port.
virtual OutputDataStreamPort * createOutputDataStreamPort(const std::string &name, Node *node, TypeCode *type)
virtual InputPort * adaptNeutralToPython(InputPort *inport, TypeCode *type)
Adapt a Neutral input port to a Python output port.
virtual TypeCode * createInterfaceTc(const std::string &id, const std::string &name, std::list< TypeCodeObjref * > ltc)
virtual std::vector< std::pair< std::string, int > > getCatalogOfComputeNodes() const
virtual InputPort * adaptCppToPython(InputCppPort *source, TypeCode *type)
Adapt a C++ input port to a Python output port.
virtual InputPort * adaptXmlToPython(InputXmlPort *inport, TypeCode *type)
Adapt a XML input port to a Python output port.
virtual InputPort * adaptPythonToXml(InputPyPort *source, TypeCode *type)
Adapt a Python input port to a Xml output port.
CORBA::ORB_ptr getOrb() const
virtual ServiceInlineNode * createSInlineNode(const std::string &kind, const std::string &name)
virtual InputPort * adaptNeutralToCpp(InputPort *inport, TypeCode *type)
Adapt a Neutral input port to a C++ output port.
virtual ComponentInstance * createComponentInstance(const std::string &name, const std::string &kind="")
virtual DataNode * createOutDataNode(const std::string &kind, const std::string &name)
virtual ServiceNode * createRefNode(const std::string &kind, const std::string &name)
virtual InputPort * adaptCorbaToCpp(InputCorbaPort *source, TypeCode *type)
Adapt a CORBA input port to a C++ output port.
virtual InputPort * adaptCppToNeutral(InputCppPort *source, TypeCode *type)
Adapt a C++ input port to a Neutral output port.
virtual InputPort * adaptCppToXml(InputCppPort *source, TypeCode *type)
virtual InputPort * adaptCorbaToPython(InputCorbaPort *source, TypeCode *type)
Adapt a CORBA input port to a Python output port.
virtual InputPort * adaptPythonToNeutral(InputPyPort *source, TypeCode *type)
Adapt a Python input port to a Neutral data port.
PyObject * getBuiltins() const
PyObject * getPyOrb() const
DynamicAny::DynAnyFactory_ptr getDynFactory() const
virtual InlineFuncNode * createFuncNode(const std::string &kind, const std::string &name)
PyObject * launchSubProcess(const std::vector< std::string > &cmds)
virtual InputPort * adapt(InputPort *source, const std::string &impl, TypeCode *type, bool init=false)
Main adapter function : adapt an InputPort to be able to connect it to an OutputPort with a possible ...
ConnectionManager _connectionManager
virtual std::string convertPyObjectToString(PyObject *ob)
virtual Bloc * createBloc(const std::string &name)
virtual InputPort * adaptCorbaToNeutral(InputCorbaPort *source, TypeCode *type)
Adapt a CORBA input port to a neutral data.
virtual DataNode * createInDataNode(const std::string &kind, const std::string &name)
virtual InputPort * adaptXmlToCorba(InputXmlPort *source, TypeCode *type)
Adapt a XML input port to connect it to a CORBA output port.
virtual ServiceNode * createCompoNode(const std::string &kind, const std::string &name)
virtual OutputPort * createOutputPort(const std::string &name, const std::string &impl, Node *node, TypeCode *type)
virtual ForLoop * createForLoop(const std::string &name)
virtual InputPort * adaptXmlToCpp(InputXmlPort *inport, TypeCode *type)
Adapt a XML input port to a C++ output port.
virtual InputPort * adaptNeutral(InputPort *source, const std::string &impl, TypeCode *type, bool init)
Adapt a Neutral input port to connect it to an output port with a given implementation.
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 InputPort * adaptCorbaToCorba(InputCorbaPort *source, TypeCode *type)
Adapt a CORBA input port to a CORBA output port.
virtual std::string getVersion() const
virtual InputPort * adaptXmlToNeutral(InputXmlPort *inport, TypeCode *type)
Adapt a XML input port to a Neutral output port.
virtual InputPort * adaptPythonToCpp(InputPyPort *source, TypeCode *type)
Adapt a Python input port to a C++ output port.
static const char RUNTIME_ENGINE_INTERACTION_IMPL_NAME[]
static YACS::ENGINE::TypeCode * _tc_double
virtual Switch * createSwitch(const std::string &name)
static YACS::ENGINE::TypeCode * _tc_bool
Catalog * _builtinCatalog
virtual ForEachLoop * createForEachLoop(const std::string &name, TypeCode *type)
static Runtime * _singleton
std::set< std::string > _setOfImplementation
std::map< std::string, CatalogLoader * > _catalogLoaderFactoryMap
static YACS::ENGINE::TypeCode * _tc_int
static YACS::ENGINE::TypeCode * _tc_string
Class for Salome component instance.
Class for Salome component Service Node.
class to build optimization loops
Class for calculation node associated with a component service.
Base class for all type objects.
static TypeCode * interfaceTc(const char *id, const char *name)
static factory of object reference type given an id and a name
virtual const char * id() const
virtual const TypeCode * contentType() const
virtual int isA(const char *repositoryId) const
static TypeCode * sequenceTc(const char *id, const char *name, TypeCode *content)
static factory of sequence type given an id, a name and a content type
virtual int isAdaptable(const TypeCode *tc) const
Check if this TypeCode is adaptable to a given TypeCode (tc)
static TypeCode * structTc(const char *id, const char *name)
static factory of struct type given an id and a name
virtual const char * shortName() const
static const char IMPL_NAME[]
const char * what(void) const noexcept
int isAdaptableCppPyObject(const TypeCode *t1, const TypeCode *t2)
std::string convertPyObjectToString(PyObject *ob)
int isAdaptableCorbaCorba(const TypeCode *t1, const TypeCode *t2)
YACSRUNTIMESALOME_EXPORT RuntimeSALOME * getSALOMERuntime()
int isAdaptableCppCorba(const TypeCode *t1, const TypeCode *t2)
int isAdaptableCorbaNeutral(const TypeCode *t1, const TypeCode *t2)
int isAdaptableCppXml(const TypeCode *t1, const TypeCode *t2)
PyObject * newPyStdOut(std::string &out)
int isAdaptablePyObjectCpp(const TypeCode *t1, const TypeCode *t2)
int isAdaptablePyObjectCorba(const TypeCode *t1, const TypeCode *t2)
int isAdaptablePyObjectPyObject(const TypeCode *t1, const TypeCode *t2)
int isAdaptableCorbaPyObject(const TypeCode *t1, const TypeCode *t2)
int isAdaptableCorbaCpp(const TypeCode *t1, const TypeCode *t2)
PyObject * convertNeutralPyObject(const TypeCode *t, YACS::ENGINE::Any *data)
int isAdaptableXmlCorba(const TypeCode *t1, const TypeCode *t2)
int isAdaptableNeutralCpp(const TypeCode *t1, const TypeCode *t2)
int isAdaptablePyObjectNeutral(const TypeCode *t1, const TypeCode *t2)