23 #define private public
24 #define protected public
25 #include <omniORB4/CORBA.h>
26 #include <omniORB4/internal/typecode.h>
32 #include "Salome_file_i.hxx"
35 #include "SALOME_GenericObj.hh"
46 int mkstemp(
char *tmpl)
49 mktemp(tmpl); ret=open(tmpl,O_RDWR|O_BINARY|O_CREAT|O_EXCL|_O_SHORT_LIVED, _S_IREAD|_S_IWRITE);
90 msg <<
"Conversion not implemented: kind= " <<
t->kind();
91 msg <<
" : " << __FILE__ <<
":" << __LINE__;
97 return CORBA::TypeCode::_duplicate(CORBA::_tc_double);
102 return CORBA::TypeCode::_duplicate(CORBA::_tc_long);
107 return CORBA::TypeCode::_duplicate(CORBA::_tc_string);
112 return CORBA::TypeCode::_duplicate(CORBA::_tc_boolean);
117 DEBTRACE(
t->name() <<
" " <<
t->shortName() <<
" " <<
t->id());
118 CORBA::TypeCode_ptr tc;
119 if(strncmp(
t->id(),
"python",6)==0 )
120 tc= CORBA::TypeCode::_duplicate(Engines::_tc_fileBlock);
121 else if(strncmp(
t->id(),
"json",4)==0)
122 tc= CORBA::TypeCode::_duplicate(CORBA::_tc_string);
126 DEBTRACE(
"refcount CORBA tc Objref: " << ((omni::TypeCode_base*)tc)->pd_ref_count);
133 CORBA::TypeCode_var content_type=
getCorbaTC(
t->contentType());
136 DEBTRACE(
"refcount CORBA content_type: " << ((omni::TypeCode_base*)content_type.in())->pd_ref_count);
137 DEBTRACE(
"refcount CORBA tc: " << ((omni::TypeCode_base*)tc)->pd_ref_count);
144 CORBA::StructMemberSeq mseq;
147 mseq.length(nMember);
148 for(
int i=0;
i<nMember;
i++)
152 mseq[
i].
name=CORBA::string_dup(name);
157 DEBTRACE(
"refcount CORBA tc: " << ((omni::TypeCode_base*)tc)->pd_ref_count);
194 template <ImplType IMPLIN,ImplType IMPLOUT>
inline int isAdaptable(
const TypeCode *
t1,
const TypeCode*
t2);
196 template <ImplType IMPLIN,ImplType IMPLOUT>
202 if(
t1->kind() ==
Int)
return 1;
206 template <ImplType IMPLIN,ImplType IMPLOUT>
211 if(
t1->kind() ==
Int)
return 1;
215 template <ImplType IMPLIN,ImplType IMPLOUT>
224 template <ImplType IMPLIN,ImplType IMPLOUT>
229 if(
t1->kind() ==
Bool)
return 1;
230 if(
t1->kind() ==
Int)
return 1;
234 template <ImplType IMPLIN,ImplType IMPLOUT>
242 if(
t1->isA(
t2->id()) )
253 if(t1cc->
kind() ==
Objref && std::string(t1cc->
id())==std::string(
t2->id()))
259 template <ImplType IMPLIN,ImplType IMPLOUT>
266 if(isAdaptable<IMPLIN,IMPLOUT>(
t1->contentType(),
t2->contentType()))
274 template <ImplType IMPLIN,ImplType IMPLOUT>
282 template <ImplType IMPLIN,ImplType IMPLOUT>
301 template <ImplType IMPLIN,ImplType IMPLOUT>
331 return isAdaptable<PYTHONImpl,CORBAImpl>(
t1,
t2);
335 return isAdaptable<PYTHONImpl,NEUTRALImpl>(
t1,
t2);
339 return isAdaptable<PYTHONImpl,PYTHONImpl>(
t1,
t2);
345 return isAdaptable<NEUTRALImpl,CORBAImpl>(
t1,
t2);
349 return isAdaptable<NEUTRALImpl,PYTHONImpl>(
t1,
t2);
353 return isAdaptable<NEUTRALImpl,XMLImpl>(
t1,
t2);
363 return isAdaptable<XMLImpl,NEUTRALImpl>(
t1,
t2);
369 return isAdaptable<CORBAImpl,NEUTRALImpl>(
t1,
t2);
373 return isAdaptable<CORBAImpl,XMLImpl>(
t1,
t2);
377 return isAdaptable<CORBAImpl,CORBAImpl>(
t1,
t2);
381 return isAdaptable<CORBAImpl,PYTHONImpl>(
t1,
t2);
389 template <ImplType IMPLIN,
class TIN,
class TIN2,ImplType IMPLOUT,
class TOUT>
395 msg <<
"Conversion not implemented: kind= " <<
t->kind() <<
" Implementation: " << IMPLIN <<
" to: " << IMPLOUT;
396 msg <<
" : " << __FILE__ <<
":" << __LINE__;
400 template <ImplType IMPLIN,
class TIN,
class TIN2,ImplType IMPLOUT,
class TOUT>
406 msg <<
"Conversion not implemented: kind= " <<
t->kind() <<
" Implementation: " << IMPLIN <<
" to: " << IMPLOUT;
407 msg <<
" : " << __FILE__ <<
":" << __LINE__;
411 template <ImplType IMPLIN,
class TIN,
class TIN2,ImplType IMPLOUT,
class TOUT>
417 msg <<
"Conversion not implemented: kind= " <<
t->kind() <<
" Implementation: " << IMPLIN <<
" to: " << IMPLOUT;
418 msg <<
" : " << __FILE__ <<
":" << __LINE__;
422 template <ImplType IMPLIN,
class TIN,
class TIN2,ImplType IMPLOUT,
class TOUT>
428 msg <<
"Conversion not implemented: kind= " <<
t->kind() <<
" Implementation: " << IMPLIN <<
" to: " << IMPLOUT;
429 msg <<
" : " << __FILE__ <<
":" << __LINE__;
433 template <ImplType IMPLIN,
class TIN,
class TIN2,ImplType IMPLOUT,
class TOUT>
439 msg <<
"Conversion not implemented: kind= " <<
t->kind() <<
" Implementation: " << IMPLIN <<
" to: " << IMPLOUT;
440 msg <<
" : " << __FILE__ <<
":" << __LINE__;
444 template <ImplType IMPLIN,
class TIN,
class TIN2,ImplType IMPLOUT,
class TOUT>
450 msg <<
"Conversion not implemented: kind= " <<
t->kind() <<
" Implementation: " << IMPLIN <<
" to: " << IMPLOUT;
451 msg <<
" : " << __FILE__ <<
":" << __LINE__;
455 template <ImplType IMPLIN,
class TIN,
class TIN2,ImplType IMPLOUT,
class TOUT>
461 msg <<
"Conversion not implemented: kind= " <<
t->kind() <<
" Implementation: " << IMPLIN <<
" to: " << IMPLOUT;
462 msg <<
" : " << __FILE__ <<
":" << __LINE__;
466 template <ImplType IMPLIN,
class TIN,
class TIN2,ImplType IMPLOUT,
class TOUT>
472 msg <<
"Conversion not implemented: kind= " <<
t->kind() <<
" Implementation: " << IMPLIN <<
" to: " << IMPLOUT;
473 msg <<
" : " << __FILE__ <<
":" << __LINE__;
482 template <ImplType IMPLOUT,
class TOUT>
488 msg <<
"Conversion not implemented: kind= " <<
t->kind() <<
" Implementation: " << IMPLOUT;
489 msg <<
" : " << __FILE__ <<
":" << __LINE__;
493 template <ImplType IMPLOUT,
class TOUT>
499 msg <<
"Conversion not implemented: kind= " <<
t->kind() <<
" Implementation: " << IMPLOUT;
500 msg <<
" : " << __FILE__ <<
":" << __LINE__;
504 template <ImplType IMPLOUT,
class TOUT>
510 msg <<
"Conversion not implemented: kind= " <<
t->kind() <<
" Implementation: " << IMPLOUT;
511 msg <<
" : " << __FILE__ <<
":" << __LINE__;
515 template <ImplType IMPLOUT,
class TOUT>
521 msg <<
"Conversion not implemented: kind= " <<
t->kind() <<
" Implementation: " << IMPLOUT;
522 msg <<
" : " << __FILE__ <<
":" << __LINE__;
526 template <ImplType IMPLOUT,
class TOUT>
532 msg <<
"Conversion not implemented: kind= " <<
t->kind() <<
" Implementation: " << IMPLOUT;
533 msg <<
" : " << __FILE__ <<
":" << __LINE__;
537 template <ImplType IMPLOUT,
class TOUT>
543 msg <<
"Conversion not implemented: kind= " <<
t->kind() <<
" Implementation: " << IMPLOUT;
544 msg <<
" : " << __FILE__ <<
":" << __LINE__;
548 template <ImplType IMPLOUT,
class TOUT>
554 msg <<
"Conversion not implemented: kind= " <<
t->kind() <<
" Implementation: " << IMPLOUT;
555 msg <<
" : " << __FILE__ <<
":" << __LINE__;
559 template <ImplType IMPLOUT,
class TOUT>
565 msg <<
"Conversion not implemented: kind= " <<
t->kind() <<
" Implementation: " << IMPLOUT;
566 msg <<
" : " << __FILE__ <<
":" << __LINE__;
570 template <ImplType IMPLIN,
class TIN,
class TIN2,ImplType IMPLOUT,
class TOUT>
578 template <ImplType IMPLIN,
class TIN,
class TIN2,ImplType IMPLOUT,
class TOUT>
586 template <ImplType IMPLIN,
class TIN,
class TIN2,ImplType IMPLOUT,
class TOUT>
594 template <ImplType IMPLIN,
class TIN,
class TIN2,ImplType IMPLOUT,
class TOUT>
602 template <ImplType IMPLIN,
class TIN,
class TIN2,ImplType IMPLOUT,
class TOUT>
616 template <ImplType IMPLIN,
class TIN,
class TIN2,ImplType IMPLOUT,
class TOUT>
624 template <ImplType IMPLIN,
class TIN,
class TIN2,ImplType IMPLOUT,
class TOUT>
632 template <ImplType IMPLIN,
class TIN,
class TIN2,ImplType IMPLOUT,
class TOUT>
635 std::map<std::string,TOUT> v;
641 template <ImplType IMPLIN,
class TIN,
class TIN2,ImplType IMPLOUT,
class TOUT>
648 return convertDouble<IMPLIN,TIN,TIN2,IMPLOUT,TOUT>(
t,o,aux);
650 return convertInt<IMPLIN,TIN,TIN2,IMPLOUT,TOUT>(
t,o,aux);
652 return convertString<IMPLIN,TIN,TIN2,IMPLOUT,TOUT>(
t,o,aux);
654 return convertBool<IMPLIN,TIN,TIN2,IMPLOUT,TOUT>(
t,o,aux);
656 return convertObjref<IMPLIN,TIN,TIN2,IMPLOUT,TOUT>(
t,o,aux);
658 return convertSequence<IMPLIN,TIN,TIN2,IMPLOUT,TOUT>(
t,o,aux);
660 return convertArray<IMPLIN,TIN,TIN2,IMPLOUT,TOUT>(
t,o,aux);
662 return convertStruct<IMPLIN,TIN,TIN2,IMPLOUT,TOUT>(
t,o,aux);
667 msg <<
"Conversion not implemented: kind= " << tk <<
" Implementation: " << IMPLOUT;
668 msg <<
" : " << __FILE__ <<
":" << __LINE__;
677 template <ImplType IMPLOUT,
class TOUT>
683 x=PyFloat_AsDouble(o);
684 if( PyErr_Occurred() )
686 PyErr_Restore(
nullptr,
nullptr,
nullptr);
688 msg <<
"Not a python double. ";
690 msg <<
"kind=" <<
t->kind() ;
691 msg <<
" ( " << __FILE__ <<
":" << __LINE__ <<
")";
698 template <ImplType IMPLOUT,
class TOUT>
705 if( PyErr_Occurred() )
707 PyErr_Restore(
nullptr,
nullptr,
nullptr);
709 msg <<
"Not a python integer. ";
711 msg <<
"kind=" <<
t->kind() ;
712 msg <<
" ( " << __FILE__ <<
":" << __LINE__ <<
")";
719 template <ImplType IMPLOUT,
class TOUT>
725 if (PyUnicode_Check(o))
728 const char *ptr = PyUnicode_AsUTF8AndSize(o, &size);
736 msg <<
"Not a python string. ";
738 msg <<
"kind=" <<
t->kind() ;
739 msg <<
" ( " << __FILE__ <<
":" << __LINE__ <<
")";
746 template <ImplType IMPLOUT,
class TOUT>
754 else if(PyLong_Check(o))
755 l=(PyLong_AsLong(o)!=0);
759 msg <<
"Not a python boolean. ";
761 msg <<
"kind=" <<
t->kind() ;
762 msg <<
" ( " << __FILE__ <<
":" << __LINE__ <<
")";
769 template <ImplType IMPLOUT,
class TOUT>
774 if (PyUnicode_Check(o) && strncmp(
t->id(),
"python",6)!=0)
779 const char *ptr = PyUnicode_AsUTF8AndSize(o, &size);
785 if(strncmp(
t->id(),
"python",6)==0)
791 PyObject* mod=PyImport_ImportModule(
"pickle");
792 PyObject *pickled=PyObject_CallMethod(mod,(
char *)
"dumps",(
char *)
"Oi",o,protocol);
805 std::string mystr(PyBytes_AsString(pickled),PyBytes_Size(pickled));
809 else if(strncmp(
t->id(),
"json",4)==0)
812 PyObject* mod=PyImport_ImportModule(
"simplejson");
818 PyObject *pickled=PyObject_CallMethod(mod,(
char *)
"dumps",(
char *)
"O",o);
825 std::string mystr=PyBytes_AsString(pickled);
832 PyObject *pystring=PyObject_CallMethod(
getSALOMERuntime()->getPyOrb(),(
char *)
"object_to_string",(
char *)
"O",o);
840 const char *ptr = PyUnicode_AsUTF8AndSize(pystring, &size);
843 mystr.assign(ptr, size);
849 template <ImplType IMPLOUT,
class TOUT>
854 if(!PySequence_Check(o))
857 msg <<
"Problem in conversion: the python object is not a sequence " << std::endl;
859 msg <<
" ( " << __FILE__ <<
":" << __LINE__ <<
")";
863 int length=PySequence_Size(o);
866 for(
int i=0;
i<length;
i++)
868 PyObject *item=PySequence_ITEM(o,
i);
879 std::cerr <<
"item[" <<
i <<
"]=";
880 PyObject_Print(item,stderr,Py_PRINT_RAW);
881 std::cerr << std::endl;
883 DEBTRACE(
"item refcnt: " << item->ob_refcnt );
886 TOUT ro=YacsConvertor<PYTHONImpl,PyObject*,void*,IMPLOUT,TOUT>(
t->contentType(),item,0);
893 msg <<
ex.what() <<
" for sequence element " <<
i;
899 template <ImplType IMPLOUT,
class TOUT>
904 DEBTRACE(
"o refcnt: " << o->ob_refcnt );
905 PyObject *key, *value;
909 for(
int i=0;
i<nMember;
i++)
914 value=PyDict_GetItemString(o, name.c_str());
920 PyObject_Print(o,stderr,Py_PRINT_RAW);
921 std::cerr << std::endl;
924 msg <<
"member " << name <<
" not present " ;
927 DEBTRACE(
"value refcnt: " << value->ob_refcnt );
930 TOUT ro=YacsConvertor<PYTHONImpl,PyObject*,void*,IMPLOUT,TOUT>(tm,value,0);
935 std::string s=
" for struct member "+name;
952 PyObject *pyob=PyFloat_FromDouble(o);
961 PyObject *pyob=PyLong_FromLong(o);
970 return PyUnicode_FromString(o.c_str());
978 return PyBool_FromLong ((
long)o);
991 if(
t->isA(Runtime::_tc_file))
994 return PyUnicode_FromString(o.c_str());
996 if(strncmp(
t->id(),
"python",6)==0)
999 PyObject* mod=PyImport_ImportModule(
"pickle");
1002 PyObject *ob=PyObject_CallMethod(mod,(
char *)
"loads",(
char *)
"y#",o.c_str(),
l);
1006 GURU_YACSTRACE(
"convertFromYacsObjref : Analyze if it's a proxy");
1011 GURU_YACSTRACE(
"convertFromYacsObjref : It's a proxy -> activate on deletion");
1021 if(strncmp(
t->id(),
"json",4)==0)
1024 PyObject* mod=PyImport_ImportModule(
"simplejson");
1031 PyObject *ob=PyObject_CallMethod(mod,(
char *)
"loads",(
char *)
"y",o.c_str(),
l);
1048 CORBA::Object_var obref;
1053 DEBTRACE(
"obref refCount: " << obref->_PR_getobj()->pd_refCount);
1056 catch(CORBA::Exception&
ex)
1058 DEBTRACE(
"Can't get reference to object." );
1062 if(obref->_non_existent())
1067 if( CORBA::is_nil(obref) )
1069 DEBTRACE(
"Can't get reference to object (or it was nil)." );
1073 if(!obref->_is_a(
t->id()))
1076 msg <<
"Problem in conversion: an objref " <<
t->id() <<
" is expected " << endl;
1077 msg <<
"An objref of type " << obref->_PD_repoId <<
" is given " << endl;
1078 msg <<
" (" << __FILE__ <<
":" << __LINE__ <<
")";
1082 DEBTRACE(
"obref refCount: " << obref->_PR_getobj()->pd_refCount);
1085 std::cerr <<
"_PD_repoId: " << obref->_PD_repoId << std::endl;
1086 std::cerr <<
"_mostDerivedRepoId: " << obref->_PR_getobj()->_mostDerivedRepoId() << std::endl;
1094 PyObject_Print(ob,stderr,Py_PRINT_RAW);
1095 std::cerr << std::endl;
1096 std::cerr <<
"obref is a generic: " << obref->_is_a(
"IDL:SALOME/GenericObj:1.0") << std::endl;
1098 std::cerr << std::endl;
1102 if(obref->_is_a(
"IDL:SALOME/GenericObj:1.0"))
1104 PyObject *result = PyObject_CallMethod(
getSALOMERuntime()->get_omnipy(), (
char *)
"narrow", (
char *)
"Osi",ob,
"IDL:SALOME/GenericObj:1.0",1);
1107 else if(result==Py_None)
1113 PyObject_Print(result,stderr,Py_PRINT_RAW);
1114 std::cerr << std::endl;
1122 DEBTRACE(
"obref refCount: " << obref->_PR_getobj()->pd_refCount);
1133 std::vector<PyObject*>::const_iterator iter;
1134 PyObject *pyob = PyList_New(v.size());
1136 for(iter=v.begin();iter!=v.end();iter++)
1138 PyObject* item=*iter;
1139 DEBTRACE(
"item refcnt: " << item->ob_refcnt );
1140 PyList_SetItem(pyob,
i,item);
1141 DEBTRACE(
"item refcnt: " << item->ob_refcnt );
1152 PyObject *pyob = PyDict_New();
1153 std::map<std::string, PyObject*>::const_iterator pt;
1154 for(pt=
m.begin();pt!=
m.end();pt++)
1156 std::string name=(*pt).first;
1157 PyObject* item=(*pt).second;
1158 DEBTRACE(
"item refcnt: " << item->ob_refcnt );
1159 PyDict_SetItemString(pyob,name.c_str(),item);
1161 DEBTRACE(
"item refcnt: " << item->ob_refcnt );
1163 DEBTRACE(
"pyob refcnt: " << pyob->ob_refcnt );
1174 template <ImplType IMPLOUT,
class TOUT>
1180 cur = cur->xmlChildrenNode;
1183 if ((!xmlStrcmp(cur->name, (
const xmlChar *)
"double")))
1187 s = xmlNodeListGetString(
doc, cur->xmlChildrenNode, 1);
1190 DEBTRACE(
"convertToYacsDouble " << (
const char *)s );
1191 d=
Cstr2d((
const char *)s);
1196 DEBTRACE(
"############### workaround to improve...");
1200 else if ((!xmlStrcmp(cur->name, (
const xmlChar *)
"int")))
1204 s = xmlNodeListGetString(
doc, cur->xmlChildrenNode, 1);
1207 DEBTRACE(
"convertToYacsDouble " << (
const char *)s );
1208 d=
Cstr2d((
const char *)s);
1213 DEBTRACE(
"############### workaround to improve...");
1220 msg <<
"Problem in conversion from Xml to " <<
getImplName(IMPLOUT) <<
" with type: " <<
t->id() ;
1221 msg <<
" (" << __FILE__ <<
":" << __LINE__ <<
")";
1225 template <ImplType IMPLOUT,
class TOUT>
1231 cur = cur->xmlChildrenNode;
1234 if ((!xmlStrcmp(cur->name, (
const xmlChar *)
"int")))
1237 s = xmlNodeListGetString(
doc, cur->xmlChildrenNode, 1);
1240 DEBTRACE(
"convertToYacsInt " << (
const char *)s );
1241 d=atol((
const char *)s);
1246 DEBTRACE(
"############### workaround to improve...");
1253 msg <<
"Problem in conversion from Xml to " <<
getImplName(IMPLOUT) <<
" with type: " <<
t->id() ;
1254 msg <<
" (" << __FILE__ <<
":" << __LINE__ <<
")";
1258 template <ImplType IMPLOUT,
class TOUT>
1263 cur = cur->xmlChildrenNode;
1266 if ((!xmlStrcmp(cur->name, (
const xmlChar *)
"string")))
1270 s = xmlNodeListGetString(
doc, cur->xmlChildrenNode, 1);
1272 DEBTRACE(
"convertToYacsString " << (
const char *)s );
1273 std::string mystr=std::string((
const char *)s);
1280 msg <<
"Problem in conversion from Xml to " <<
getImplName(IMPLOUT) <<
" with type: " <<
t->id() ;
1281 msg <<
" (" << __FILE__ <<
":" << __LINE__ <<
")";
1285 template <ImplType IMPLOUT,
class TOUT>
1290 cur = cur->xmlChildrenNode;
1293 if ((!xmlStrcmp(cur->name, (
const xmlChar *)
"boolean")))
1297 s = xmlNodeListGetString(
doc, cur->xmlChildrenNode, 1);
1301 DEBTRACE(
"convertToYacsBool " << (
const char *)s );
1302 ob=atoi((
const char*)s)!=0;
1307 DEBTRACE(
"############### workaround to improve...");
1314 msg <<
"Problem in conversion from Xml to " <<
getImplName(IMPLOUT) <<
" with type: " <<
t->id() ;
1315 msg <<
" (" << __FILE__ <<
":" << __LINE__ <<
")";
1319 template <ImplType IMPLOUT,
class TOUT>
1324 cur = cur->xmlChildrenNode;
1327 if ((!xmlStrcmp(cur->name, (
const xmlChar *)
"objref")))
1331 std::string mystr =
"";
1332 s = xmlNodeListGetString(
doc, cur->xmlChildrenNode, 1);
1335 DEBTRACE(
"convertToYacsObjref " << (
const char *)s );
1336 mystr = (
const char *)s;
1341 DEBTRACE(
"############### workaround to improve...");
1343 if(strncmp(
t->id(),
"python",6)==0 )
1348 else if ((!xmlStrcmp(cur->name, (
const xmlChar *)
"string")))
1352 s = xmlNodeListGetString(
doc, cur->xmlChildrenNode, 1);
1354 DEBTRACE(
"convertToYacsString " << (
const char *)s );
1355 std::string mystr=std::string((
const char *)s);
1362 msg <<
"Problem in conversion from Xml to " <<
getImplName(IMPLOUT) <<
" with type: " <<
t->id() ;
1363 msg <<
" (" << __FILE__ <<
":" << __LINE__ <<
")";
1367 template <ImplType IMPLOUT,
class TOUT>
1372 cur = cur->xmlChildrenNode;
1375 if ((!xmlStrcmp(cur->name, (
const xmlChar *)
"array")))
1378 xmlNodePtr cur1=cur->xmlChildrenNode;
1379 while (cur1 != NULL)
1381 if ((!xmlStrcmp(cur1->name, (
const xmlChar *)
"data")))
1384 xmlNodePtr cur2=cur1->xmlChildrenNode;
1385 while (cur2 != NULL)
1388 if ((!xmlStrcmp(cur2->name, (
const xmlChar *)
"value")))
1390 TOUT ro=YacsConvertor<XMLImpl,xmlDocPtr,xmlNodePtr,IMPLOUT,TOUT>(
t->contentType(),
doc,cur2);
1405 template <ImplType IMPLOUT,
class TOUT>
1413 std::map<std::string,TypeCode*> mtc;
1414 for(
int i=0;
i<nMember;
i++)
1419 cur = cur->xmlChildrenNode;
1422 if ((!xmlStrcmp(cur->name, (
const xmlChar *)
"struct")))
1425 xmlNodePtr cur1=cur->xmlChildrenNode;
1426 while (cur1 != NULL)
1428 if ((!xmlStrcmp(cur1->name, (
const xmlChar *)
"member")))
1431 xmlNodePtr cur2=cur1->xmlChildrenNode;
1432 while (cur2 != NULL)
1435 if ((!xmlStrcmp(cur2->name, (
const xmlChar *)
"name")))
1438 s = xmlNodeListGetString(
doc, cur2->xmlChildrenNode, 1);
1439 std::string name= (
char *)s;
1441 while (cur2 != NULL)
1443 if ((!xmlStrcmp(cur2->name, (
const xmlChar *)
"value")))
1445 TOUT ro=YacsConvertor<XMLImpl,xmlDocPtr,xmlNodePtr,IMPLOUT,TOUT>(mtc[name],
doc,cur2);
1477 msg <<
"<value><double>" << setprecision(16) << o <<
"</double></value>\n";
1487 msg <<
"<value><int>" << o <<
"</int></value>\n";
1496 std::string msg=
"<value><string>";
1497 return msg+o+
"</string></value>\n";
1506 msg <<
"<value><boolean>" << o <<
"</boolean></value>\n";
1515 if(strncmp(
t->id(),
"python",6)==0 )
1516 return "<value><objref><![CDATA[" +
ToBase64(o) +
"]]></objref></value>\n";
1517 else if(strncmp(
t->id(),
"json",4)==0)
1518 return "<value><objref><![CDATA[" + o +
"]]></objref></value>\n";
1520 return "<value><objref>" + o +
"</objref></value>\n";
1529 std::vector<std::string>::const_iterator iter;
1531 xmlob <<
"<value><array><data>\n";
1532 for(iter=v.begin();iter!=v.end();iter++)
1536 xmlob <<
"</data></array></value>\n";
1546 std::string result=
"<value><struct>\n";
1547 std::map<std::string, std::string>::const_iterator pt;
1548 for(pt=
m.begin();pt!=
m.end();pt++)
1550 std::string name=(*pt).first;
1551 std::string item=(*pt).second;
1552 result=result+
"<member>\n";
1553 result=result+
"<name>"+name+
"</name>\n";
1555 result=result+
"</member>\n";
1557 result=result+
"</struct></value>\n";
1569 template <ImplType IMPLOUT,
class TOUT>
1580 msg <<
"Problem in conversion: a double or int is expected " ;
1581 msg <<
" (" << __FILE__ <<
":" << __LINE__ <<
")";
1585 template <ImplType IMPLOUT,
class TOUT>
1593 msg <<
"Problem in conversion: a int is expected " ;
1594 msg <<
" (" << __FILE__ <<
":" << __LINE__ <<
")";
1598 template <ImplType IMPLOUT,
class TOUT>
1606 msg <<
"Problem in conversion: a string is expected " ;
1607 msg <<
" (" << __FILE__ <<
":" << __LINE__ <<
")";
1611 template <ImplType IMPLOUT,
class TOUT>
1621 msg <<
"Problem in conversion: a bool or int is expected " ;
1622 msg <<
" (" << __FILE__ <<
":" << __LINE__ <<
")";
1626 template <ImplType IMPLOUT,
class TOUT>
1634 msg <<
"Problem in conversion: a objref(string) is expected " ;
1635 msg <<
" (" << __FILE__ <<
":" << __LINE__ <<
")";
1639 template <ImplType IMPLOUT,
class TOUT>
1645 int length=sdata->
size();
1647 for(
int i=0;
i<length;
i++)
1649 TOUT ro=YacsConvertor<NEUTRALImpl,YACS::ENGINE::Any*,void*,IMPLOUT,TOUT>(
t->contentType(),(*sdata)[
i],0);
1654 template <ImplType IMPLOUT,
class TOUT>
1666 TOUT ro=YacsConvertor<NEUTRALImpl,YACS::ENGINE::Any*,void*,IMPLOUT,TOUT>(tst->
memberType(
i),(*sdata)[name.c_str()],0);
1716 if(o==
"" || (
t->isA(Runtime::_tc_file)) || (strncmp(
t->id(),
"python",6)==0) || (strncmp(
t->id(),
"json",4)==0))
1720 CORBA::Object_var obref;
1725 catch(CORBA::Exception&
ex)
1729 if(obref->_non_existent())
1731 if( CORBA::is_nil(obref) )
1733 if(!obref->_is_a(
t->id()))
1736 msg <<
"Problem in conversion: an objref " <<
t->id() <<
" is expected " << endl;
1737 msg <<
"An objref of type " << obref->_PD_repoId <<
" is given " << endl;
1738 msg <<
" (" << __FILE__ <<
":" << __LINE__ <<
")";
1742 SALOME::GenericObj_var gobj=SALOME::GenericObj::_narrow(obref);
1743 if(!CORBA::is_nil(gobj))
1745 DEBTRACE(
"It's a SALOME::GenericObj register it");
1749 DEBTRACE(
"It's a CORBA::Object but not a SALOME::GenericObj");
1760 std::vector<YACS::ENGINE::Any*>::const_iterator iter;
1763 any=SequenceAny::New(
t->contentType());
1764 for(iter=v.begin();iter!=v.end();iter++)
1780 std::map<std::string,YACS::ENGINE::Any*>::const_iterator it;
1781 for (it=
m.begin() ; it!=
m.end() ; it++)
1784 it->second->decrRef();
1796 template <ImplType IMPLOUT,
class TOUT>
1801 CORBA::TypeCode_var tc = o->type();
1802 if (tc->equivalent(CORBA::_tc_double))
1808 if (tc->equivalent(CORBA::_tc_long))
1815 msg <<
"Problem in CORBA to TOUT conversion: kind= " <<
t->kind() ;
1816 msg <<
" : " << __FILE__ <<
":" << __LINE__;
1820 template <ImplType IMPLOUT,
class TOUT>
1829 msg <<
"Problem in CORBA to TOUT conversion: kind= " <<
t->kind() ;
1830 msg <<
" : " << __FILE__ <<
":" << __LINE__;
1834 template <ImplType IMPLOUT,
class TOUT>
1843 msg <<
"Problem in CORBA to TOUT conversion: kind= " <<
t->kind() ;
1844 msg <<
" : " << __FILE__ <<
":" << __LINE__;
1848 template <ImplType IMPLOUT,
class TOUT>
1854 if(*o >>= CORBA::Any::to_boolean(
b))
1857 msg <<
"Problem in Corba to TOUT conversion: kind= " <<
t->kind() ;
1858 msg <<
" : " << __FILE__ <<
":" << __LINE__;
1862 template <ImplType IMPLOUT,
class TOUT>
1867 char file[]=
"/tmp/XXXXXX";
1868 if(
t->isA(Runtime::_tc_file))
1870 Engines::Salome_file_ptr sf;
1872 Salome_file_i*
f=
new Salome_file_i();
1874 f->setDistributedFile(file);
1880 else if(strncmp(
t->id(),
"python",6)==0)
1883 Engines::fileBlock * buffer;
1886 s=(
const char*)buffer->get_buffer();
1890 std::string mystr(s,buffer->length());
1894 PyGILState_STATE gstate = PyGILState_Ensure();
1895 PyObject* mod=PyImport_ImportModule(
"pickle");
1897 PyObject *ob=PyObject_CallMethod(mod,(
char *)
"loads",(
char *)
"y#",s,
l);
1898 PyObject *pickled=PyObject_CallMethod(mod,(
char *)
"dumps",(
char *)
"Oi",ob,protocol);
1900 std::string mystr=PyBytes_AsString(pickled);
1904 PyGILState_Release(gstate);
1909 msg <<
"Problem in CORBA (protocol python) to TOUT conversion: kind= " <<
t->kind() ;
1910 msg <<
" : " << __FILE__ <<
":" << __LINE__;
1913 else if(strncmp(
t->id(),
"json",4)==0)
1921 msg <<
"Problem in CORBA (protocol json) to TOUT conversion: kind= " <<
t->kind() ;
1922 msg <<
" : " << __FILE__ <<
":" << __LINE__;
1927 CORBA::Object_var ObjRef ;
1928 *o >>= CORBA::Any::to_object(ObjRef) ;
1930 return (
char *)objref;
1934 template <ImplType IMPLOUT,
class TOUT>
1939 CORBA::TypeCode_var tc=o->type();
1940 if (tc->kind() != CORBA::tk_sequence)
1943 msg <<
"Not a sequence corba type " << tc->kind();
1944 msg <<
" : " << __FILE__ <<
":" << __LINE__;
1948 DynamicAny::DynSequence_ptr ds=DynamicAny::DynSequence::_narrow(dynany);
1949 CORBA::release(dynany);
1950 DynamicAny::AnySeq_var as=ds->get_elements();
1951 int len=as->length();
1953 for(
int i=0;
i<len;
i++)
1956 DEBTRACE(
"refcount CORBA as[i]: " << ((omni::TypeCode_base*)as[
i].pd_tc.in())->pd_ref_count);
1958 TOUT ro=YacsConvertor<CORBAImpl,CORBA::Any*,void*,IMPLOUT,TOUT>(
t->contentType(),&as[
i],0);
1963 for(
int i=0;
i<len;
i++)
1966 DEBTRACE(
"refcount CORBA as[i]: " << ((omni::TypeCode_base*)as[
i].pd_tc.in())->pd_ref_count);
1971 template <ImplType IMPLOUT,
class TOUT>
1976 CORBA::TypeCode_var tc=o->type();
1978 if (tc->kind() != CORBA::tk_struct)
1981 msg <<
"Not a struct corba type " << tc->kind();
1982 msg <<
" : " << __FILE__ <<
":" << __LINE__;
1987 DynamicAny::DynStruct_ptr ds=DynamicAny::DynStruct::_narrow(dynany);
1988 CORBA::release(dynany);
1989 DynamicAny::NameValuePairSeq_var as=ds->get_members();
1990 int len=as->length();
1991 for(
int i=0;
i<len;
i++)
1993 std::string name=as[
i].id.in();
1995 CORBA::Any value=as[
i].value;
1997 DEBTRACE(
"refcount CORBA value: " << ((omni::TypeCode_base*)value.pd_tc.in())->pd_ref_count);
1999 TOUT ro=YacsConvertor<CORBAImpl,CORBA::Any*,void*,IMPLOUT,TOUT>(tst->
memberType(
i),&value,0);
2017 CORBA::Any *any =
new CORBA::Any();
2027 CORBA::Any *any =
new CORBA::Any();
2028 *any <<= (CORBA::Long)o;
2037 CORBA::Any *any =
new CORBA::Any();
2047 CORBA::Any *any =
new CORBA::Any();
2048 *any <<= CORBA::Any::from_boolean(o);
2057 CORBA::Object_var obref;
2059 if(
t->isA(Runtime::_tc_file))
2062 Salome_file_i* aSalome_file =
new Salome_file_i();
2065 aSalome_file->setLocalFile(o.c_str());
2066 obref = aSalome_file->_this();
2067 aSalome_file->_remove_ref();
2069 catch (
const SALOME::SALOME_Exception& e)
2072 msg << e.details.text;
2073 msg <<
" : " << __FILE__ <<
":" << __LINE__;
2077 else if(strncmp(
t->id(),
"python",6)==0 )
2079 CORBA::Any *any =
new CORBA::Any();
2080 Engines::fileBlock * buffer=
new Engines::fileBlock();
2081 buffer->length(o.length());
2082 CORBA::Octet *buf=buffer->get_buffer();
2083 memcpy(buf,o.c_str(),o.length());
2087 else if(strncmp(
t->id(),
"json",4)==0)
2089 CORBA::Any *any =
new CORBA::Any();
2099 catch(CORBA::Exception&
ex)
2103 if( CORBA::is_nil(obref) )
2109 DEBTRACE(
"ObjRef refCount: " << obref->_PR_getobj()->pd_refCount);
2111 CORBA::Any *any =
new CORBA::Any();
2114 DEBTRACE(
"ObjRef refCount: " << obref->_PR_getobj()->pd_refCount);
2126 std::vector<CORBA::Any*>::const_iterator iter;
2130 if(
t->contentType()->kind() ==
Objref)
2136 DynamicAny::DynSequence_var ds = DynamicAny::DynSequence::_narrow(dynany);
2137 ds->set_length(v.size());
2139 for(iter=v.begin();iter!=v.end();iter++)
2141 DynamicAny::DynAny_var temp=ds->current_component();
2142 CORBA::Any*
a=*iter;
2146 CORBA::Object_var zzobj ;
2147 *
a >>= CORBA::Any::to_object(zzobj) ;
2148 temp->insert_reference(zzobj);
2158 CORBA::Any *any=ds->to_any();
2176 DynamicAny::DynStruct_var ds = DynamicAny::DynStruct::_narrow(dynany);
2178 for(
int i=0;
i<nMember;
i++)
2180 DynamicAny::DynAny_var temp=ds->current_component();
2184 CORBA::Any*
a=
m[name];
2186 CORBA::TypeCode_var atc = tc->member_type(
i);
2187 if(atc->kind()==CORBA::tk_objref)
2190 CORBA::Object_var zzobj ;
2191 *
a >>= CORBA::Any::to_object(zzobj) ;
2192 temp->insert_reference(zzobj);
2202 CORBA::Any *any=ds->to_any();
2212 inline CORBA::Any* convertDouble<CORBAImpl,CORBA::Any*,void*,CORBAImpl,CORBA::Any*>(
const TypeCode *
t,CORBA::Any* o,
void* aux)
2214 CORBA::TypeCode_var tc = o->type();
2215 if (tc->equivalent(CORBA::_tc_double))
2219 if (tc->equivalent(CORBA::_tc_long))
2223 CORBA::Any *any =
new CORBA::Any();
2228 msg <<
"Not a double or long corba type " << tc->kind();
2229 msg <<
" : " << __FILE__ <<
":" << __LINE__;
2233 inline CORBA::Any* convertInt<CORBAImpl,CORBA::Any*,void*,CORBAImpl,CORBA::Any*>(
const TypeCode *
t,CORBA::Any* o,
void* aux)
2238 inline CORBA::Any* convertString<CORBAImpl,CORBA::Any*,void*,CORBAImpl,CORBA::Any*>(
const TypeCode *
t,CORBA::Any* o,
void* aux)
2243 inline CORBA::Any* convertBool<CORBAImpl,CORBA::Any*,void*,CORBAImpl,CORBA::Any*>(
const TypeCode *
t,CORBA::Any* o,
void* aux)
2248 inline CORBA::Any* convertObjref<CORBAImpl,CORBA::Any*,void*,CORBAImpl,CORBA::Any*>(
const TypeCode *
t,CORBA::Any* o,
void* aux)
2253 inline CORBA::Any* convertStruct<CORBAImpl,CORBA::Any*,void*,CORBAImpl,CORBA::Any*>(
const TypeCode *
t,CORBA::Any* o,
void* aux)
2264 template <ImplType IMPLOUT,
class TOUT>
2278 msg <<
"Problem in Cpp to TOUT conversion: kind= " <<
t->kind() ;
2279 msg <<
" : " << __FILE__ <<
":" << __LINE__;
2283 template <ImplType IMPLOUT,
class TOUT>
2293 msg <<
"Problem in Cpp to TOUT conversion: kind= " <<
t->kind() ;
2294 msg <<
" : " << __FILE__ <<
":" << __LINE__;
2303 return YacsConvertor<PYTHONImpl,PyObject*,void*,XMLImpl,std::string>(
t,data,0);
2307 return YacsConvertor<PYTHONImpl,PyObject*,void*,NEUTRALImpl,YACS::ENGINE::Any*>(
t,data,0);
2311 return YacsConvertor<PYTHONImpl,PyObject*,void*,CORBAImpl,CORBA::Any*>(
t,data,0);
2315 return YacsConvertor<PYTHONImpl,PyObject*,void*,PYTHONImpl,PyObject*>(
t,data,0);
2321 PyGILState_STATE gstate = PyGILState_Ensure();
2328 s=PyObject_ASCII(ob);
2331 const char* characters = PyUnicode_AsUTF8AndSize(s, &size);
2332 std::string ss( characters, size);
2334 PyGILState_Release(gstate);
2341 return YacsConvertor<XMLImpl,xmlDocPtr,xmlNodePtr,PYTHONImpl,PyObject*>(
t,
doc,cur);
2345 return YacsConvertor<XMLImpl,xmlDocPtr,xmlNodePtr,NEUTRALImpl,YACS::ENGINE::Any*>(
t,
doc,cur);
2349 return YacsConvertor<XMLImpl,xmlDocPtr,xmlNodePtr,CORBAImpl,CORBA::Any*>(
t,
doc,cur);
2356 doc = xmlParseMemory(data.c_str(), strlen(data.c_str()));
2359 std::stringstream msg;
2360 msg <<
"Problem in conversion: XML Document not parsed successfully ";
2361 msg <<
" (" << __FILE__ <<
":" << __LINE__ <<
")";
2364 cur = xmlDocGetRootElement(
doc);
2368 std::stringstream msg;
2369 msg <<
"Problem in conversion: empty XML Document";
2370 msg <<
" (" << __FILE__ <<
":" << __LINE__ <<
")";
2375 if ((!xmlStrcmp(cur->name, (
const xmlChar *)
"value")))
2385 std::stringstream msg;
2386 msg <<
"Problem in conversion: incorrect XML value";
2387 msg <<
" (" << __FILE__ <<
":" << __LINE__ <<
")";
2395 return YacsConvertor<NEUTRALImpl,YACS::ENGINE::Any*,void*,PYTHONImpl,PyObject*>(
t,data,0);
2399 return YacsConvertor<NEUTRALImpl,YACS::ENGINE::Any*,void*,XMLImpl,std::string>(
t,data,0);
2403 return YacsConvertor<NEUTRALImpl,YACS::ENGINE::Any*,void*,CORBAImpl,CORBA::Any*>(
t,data,0);
2414 return YacsConvertor<CORBAImpl,CORBA::Any*,void*,PYTHONImpl,PyObject*>(
t,data,0);
2418 return YacsConvertor<CORBAImpl,CORBA::Any*,void*,XMLImpl,std::string>(
t,data,0);
2422 return YacsConvertor<CORBAImpl,CORBA::Any*,void*,NEUTRALImpl,YACS::ENGINE::Any*>(
t,data,0);
2426 return YacsConvertor<CORBAImpl,CORBA::Any*,void*,CORBAImpl,CORBA::Any*>(
t,data,0);
2434 template <ImplType IMPLIN,
class TIN,
class TIN2>
2438 msg <<
"Check not implemented for Implementation: " << IMPLIN ;
2439 msg <<
" : " << __FILE__ <<
":" << __LINE__;
2442 template <ImplType IMPLIN,
class TIN,
class TIN2>
2446 msg <<
"Check not implemented for Implementation: " << IMPLIN ;
2447 msg <<
" : " << __FILE__ <<
":" << __LINE__;
2450 template <ImplType IMPLIN,
class TIN,
class TIN2>
2454 msg <<
"Check not implemented for Implementation: " << IMPLIN ;
2455 msg <<
" : " << __FILE__ <<
":" << __LINE__;
2458 template <ImplType IMPLIN,
class TIN,
class TIN2>
2462 msg <<
"Check not implemented for Implementation: " << IMPLIN ;
2463 msg <<
" : " << __FILE__ <<
":" << __LINE__;
2466 template <ImplType IMPLIN,
class TIN,
class TIN2>
2470 msg <<
"Check not implemented for Implementation: " << IMPLIN ;
2471 msg <<
" : " << __FILE__ <<
":" << __LINE__;
2474 template <ImplType IMPLIN,
class TIN,
class TIN2>
2478 msg <<
"Check not implemented for Implementation: " << IMPLIN ;
2479 msg <<
" : " << __FILE__ <<
":" << __LINE__;
2482 template <ImplType IMPLIN,
class TIN,
class TIN2>
2486 msg <<
"Check not implemented for Implementation: " << IMPLIN ;
2487 msg <<
" : " << __FILE__ <<
":" << __LINE__;
2490 template <ImplType IMPLIN,
class TIN,
class TIN2>
2494 msg <<
"Check not implemented for Implementation: " << IMPLIN ;
2495 msg <<
" : " << __FILE__ <<
":" << __LINE__;
2499 template <ImplType IMPLIN,
class TIN,
class TIN2>
2506 return checkDouble<IMPLIN,TIN,TIN2>(
t,o,aux);
2508 return checkInt<IMPLIN,TIN,TIN2>(
t,o,aux);
2510 return checkString<IMPLIN,TIN,TIN2>(
t,o,aux);
2512 return checkBool<IMPLIN,TIN,TIN2>(
t,o,aux);
2514 return checkObjref<IMPLIN,TIN,TIN2>(
t,o,aux);
2516 return checkSequence<IMPLIN,TIN,TIN2>(
t,o,aux);
2518 return checkArray<IMPLIN,TIN,TIN2>(
t,o,aux);
2520 return checkStruct<IMPLIN,TIN,TIN2>(
t,o,aux);
2525 msg <<
"Check not implemented for kind= " << tk ;
2526 msg <<
" : " << __FILE__ <<
":" << __LINE__;
2532 if (PyFloat_Check(o))
2534 else if(PyLong_Check(o))
2539 msg <<
"Not a python double ";
2546 if (PyLong_Check(o))
2551 msg <<
"Not a python integer ";
2558 if (PyBool_Check(o))
2560 else if(PyLong_Check(o))
2565 msg <<
"Not a python boolean " ;
2573 if (PyUnicode_Check(o))
2578 msg <<
"Not a python string " ;
2585 if (PyUnicode_Check(o))
2587 if(strncmp(
t->id(),
"python",6)==0)
2589 else if(strncmp(
t->id(),
"json",4)==0)
2603 if(!PySequence_Check(o))
2606 msg <<
"python object is not a sequence " ;
2609 int length=PySequence_Size(o);
2610 for(
int i=0;
i<length;
i++)
2612 PyObject *item=PySequence_ITEM(o,
i);
2615 YacsChecker<PYTHONImpl,PyObject*,void*>(
t->contentType(),item,0);
2620 msg <<
ex.what() <<
" for sequence element " <<
i;
2631 if(!PyDict_Check(o))
2634 msg <<
"python object is not a dict " ;
2639 for(
int i=0;
i<nMember;
i++)
2643 value=PyDict_GetItemString(o, name.c_str());
2647 msg <<
"member " << name <<
" not present " ;
2652 YacsChecker<PYTHONImpl,PyObject*,void*>(tm,value,0);
2656 std::string s=
" for struct member "+name;
2665 return YacsChecker<PYTHONImpl,PyObject*,void*>(
t,ob,0);
double Cstr2d(const char *s)
replacement for atof witch does not work everywhere
#define YASSERT(val)
YASSERT macro is always defined, used like assert, but throw a YACS::Exception instead of abort.
#define GURU_YACSTRACE(msg)
: Interface for management of storage of data formated dynamically in its TypeCode....
virtual std::string getStringValue() const =0
virtual int getIntValue() const =0
virtual double getDoubleValue() const =0
virtual bool getBoolValue() const =0
const TypeCode * getType() const
static AtomAny * New(T val)
static void UnlinkOnDestructorIfProxy(PyObject *ob)
static bool GetDestroyStatus(PyObject *ob)
static void IfProxyDoSomething(PyObject *ob, const char *meth)
static void DoNotTouchFileIfProxy(PyObject *ob)
static bool IsProxy(PyObject *ob)
unsigned int getRefCnt() const
CORBA::Object_var getFromNS(const char *entry) const
CORBA::ORB_ptr getOrb() const
DynamicAny::DynAnyFactory_ptr getDynFactory() const
unsigned int size() const
void pushBack(const Any *elem)
void setEltAtRank(int i, const Any *elem)
Class for sequence objects.
virtual const TypeCode * contentType() const
const char * memberName(int index) const
TypeCode * memberType(int index) const
Base class for all type objects.
virtual const char * name() const
virtual const char * id() const
int isAdaptableNeutralNeutral(const TypeCode *t1, const TypeCode *t2)
PyObject * convertXmlStrPyObject(const TypeCode *t, std::string data)
CORBA::Any * convertPyObjectCorba(const TypeCode *t, PyObject *data)
int isAdaptableNeutralPyObject(const TypeCode *t1, const TypeCode *t2)
CORBA::TypeCode_ptr getCorbaTCString(const TypeCode *t)
CORBA::Any * convertCorbaCorba(const TypeCode *t, CORBA::Any *data)
std::string convertPyObjectToString(PyObject *ob)
CORBA::TypeCode_ptr getCorbaTCDouble(const TypeCode *t)
int isAdaptableCorbaCorba(const TypeCode *t1, const TypeCode *t2)
YACSLIBENGINE_EXPORT std::string FromBase64Safe(const std::string &bytes)
PyObject * convertPyObjectPyObject(const TypeCode *t, PyObject *data)
bool checkDouble< PYTHONImpl, PyObject *, void * >(const TypeCode *t, PyObject *o, void *aux)
CORBA::TypeCode_ptr getCorbaTCObjref(const TypeCode *t)
YACSRUNTIMESALOME_EXPORT RuntimeSALOME * getSALOMERuntime()
YACS::ENGINE::Any * convertCorbaNeutral(const TypeCode *t, CORBA::Any *data)
int isAdaptableCorbaNeutral(const TypeCode *t1, const TypeCode *t2)
static bool checkArray(const TypeCode *t, TIN o, TIN2 aux)
static bool checkString(const TypeCode *t, TIN o, TIN2 aux)
std::string convertPyObjectXml(const TypeCode *t, PyObject *data)
TOUT convertString(const TypeCode *t, TIN o, TIN2 aux)
bool checkInt< PYTHONImpl, PyObject *, void * >(const TypeCode *t, PyObject *o, void *aux)
PyObject * convertXmlPyObject(const TypeCode *t, xmlDocPtr doc, xmlNodePtr cur)
static bool checkObjref(const TypeCode *t, TIN o, TIN2 aux)
static bool checkBool(const TypeCode *t, TIN o, TIN2 aux)
static bool checkSequence(const TypeCode *t, TIN o, TIN2 aux)
TOUT YacsConvertor(const TypeCode *t, TIN o, TIN2 aux)
TOUT convertStruct(const TypeCode *t, TIN o, TIN2 aux)
TOUT convertBool(const TypeCode *t, TIN o, TIN2 aux)
std::string getImplName(ImplType impl)
CORBA::TypeCode_ptr getCorbaTCBool(const TypeCode *t)
static bool checkDouble(const TypeCode *t, TIN o, TIN2 aux)
Basic template checker from type TIN.
CORBA::Any * convertXmlCorba(const TypeCode *t, xmlDocPtr doc, xmlNodePtr cur)
int isAdaptablePyObjectCorba(const TypeCode *t1, const TypeCode *t2)
int isAdaptablePyObjectPyObject(const TypeCode *t1, const TypeCode *t2)
int isAdaptableCorbaPyObject(const TypeCode *t1, const TypeCode *t2)
bool checkBool< PYTHONImpl, PyObject *, void * >(const TypeCode *t, PyObject *o, void *aux)
static bool checkInt(const TypeCode *t, TIN o, TIN2 aux)
CORBA::TypeCode_ptr getCorbaTCSequence(const TypeCode *t)
YACS::ENGINE::Any * convertNeutralNeutral(const TypeCode *t, YACS::ENGINE::Any *data)
bool checkObjref< PYTHONImpl, PyObject *, void * >(const TypeCode *t, PyObject *o, void *aux)
TOUT convertDouble(const TypeCode *t, TIN o, TIN2 aux)
CORBA::TypeCode_ptr getCorbaTC(const TypeCode *t)
PyObject * convertNeutralPyObject(const TypeCode *t, YACS::ENGINE::Any *data)
static bool checkStruct(const TypeCode *t, TIN o, TIN2 aux)
TOUT convertObjref(const TypeCode *t, TIN o, TIN2 aux)
TOUT convertArray(const TypeCode *t, TIN o, TIN2 aux)
int isAdaptableXmlCorba(const TypeCode *t1, const TypeCode *t2)
CORBA::TypeCode_ptr getCorbaTCInt(const TypeCode *t)
TOUT convertSequence(const TypeCode *t, TIN o, TIN2 aux)
YACS::ENGINE::Any * convertPyObjectNeutral(const TypeCode *t, PyObject *data)
std::string convertNeutralXml(const TypeCode *t, YACS::ENGINE::Any *data)
int isAdaptableXmlNeutral(const TypeCode *t1, const TypeCode *t2)
PyObject * convertCorbaPyObject(const TypeCode *t, CORBA::Any *data)
TOUT convertInt(const TypeCode *t, TIN o, TIN2 aux)
int isAdaptableNeutralXml(const TypeCode *t1, const TypeCode *t2)
YACS::ENGINE::Any * convertXmlNeutral(const TypeCode *t, xmlDocPtr doc, xmlNodePtr cur)
CORBA::TypeCode_ptr getCorbaTCNull(const TypeCode *t)
int isAdaptableNeutralCorba(const TypeCode *t1, const TypeCode *t2)
CORBA::TypeCode_ptr(* getCorbaTCFn)(const TypeCode *)
bool YacsChecker(const TypeCode *t, TIN o, TIN2 aux)
int isAdaptablePyObjectNeutral(const TypeCode *t1, const TypeCode *t2)
bool checkSequence< PYTHONImpl, PyObject *, void * >(const TypeCode *t, PyObject *o, void *aux)
bool checkStruct< PYTHONImpl, PyObject *, void * >(const TypeCode *t, PyObject *o, void *aux)
bool checkPyObject(const TypeCode *t, PyObject *ob)
YACSLIBENGINE_EXPORT std::string ToBase64(const std::string &bytes)
CORBA::TypeCode_ptr getCorbaTCStruct(const TypeCode *t)
CORBA::Any * convertNeutralCorba(const TypeCode *t, YACS::ENGINE::Any *data)
getCorbaTCFn getCorbaTCFns[]
int isAdaptable(const TypeCode *t1, const TypeCode *t2)
std::string convertCorbaXml(const TypeCode *t, CORBA::Any *data)
bool checkString< PYTHONImpl, PyObject *, void * >(const TypeCode *t, PyObject *o, void *aux)
static TOUT convert(const TypeCode *t, std::vector< TOUT > &v)
static CORBA::Any * convert(const TypeCode *t, bool o)
static YACS::ENGINE::Any * convert(const TypeCode *t, bool o)
static PyObject * convert(const TypeCode *t, bool o)
static std::string convert(const TypeCode *t, bool o)
static TOUT convert(const TypeCode *t, bool o)
static CORBA::Any * convert(const TypeCode *t, double o)
static YACS::ENGINE::Any * convert(const TypeCode *t, double o)
static PyObject * convert(const TypeCode *t, double o)
static std::string convert(const TypeCode *t, double o)
Basic convertor from Yacs<TOUT> type to full TOUT type.
static TOUT convert(const TypeCode *t, double o)
static CORBA::Any * convert(const TypeCode *t, long o)
static YACS::ENGINE::Any * convert(const TypeCode *t, long o)
static PyObject * convert(const TypeCode *t, long o)
static std::string convert(const TypeCode *t, long o)
static TOUT convert(const TypeCode *t, long o)
static CORBA::Any * convert(const TypeCode *t, std::string &o)
static YACS::ENGINE::Any * convert(const TypeCode *t, std::string &o)
static PyObject * convert(const TypeCode *t, std::string &o)
static std::string convert(const TypeCode *t, std::string &o)
static TOUT convert(const TypeCode *t, std::string o)
static CORBA::Any * convert(const TypeCode *t, std::vector< CORBA::Any * > &v)
static YACS::ENGINE::Any * convert(const TypeCode *t, std::vector< YACS::ENGINE::Any * > &v)
static PyObject * convert(const TypeCode *t, std::vector< PyObject * > &v)
static std::string convert(const TypeCode *t, std::vector< std::string > &v)
static TOUT convert(const TypeCode *t, std::vector< TOUT > &v)
static CORBA::Any * convert(const TypeCode *t, std::string &o)
static YACS::ENGINE::Any * convert(const TypeCode *t, std::string &o)
static PyObject * convert(const TypeCode *t, std::string &o)
static std::string convert(const TypeCode *t, std::string &o)
static TOUT convert(const TypeCode *t, std::string o)
static CORBA::Any * convert(const TypeCode *t, std::map< std::string, CORBA::Any * > &m)
static YACS::ENGINE::Any * convert(const TypeCode *t, std::map< std::string, YACS::ENGINE::Any * > &m)
static PyObject * convert(const TypeCode *t, std::map< std::string, PyObject * > &m)
static std::string convert(const TypeCode *t, std::map< std::string, std::string > &m)
static TOUT convert(const TypeCode *t, std::map< std::string, TOUT > &v)
static void convert(const TypeCode *t, TIN o, TIN2 aux, std::vector< TOUT > &v)
static bool convert(const TypeCode *t, CORBA::Any *o, void *)
static bool convert(const TypeCode *t, YACS::ENGINE::Any *o, void *)
static bool convert(const TypeCode *t, PyObject *o, void *)
static bool convert(const TypeCode *t, xmlDocPtr doc, xmlNodePtr cur)
static bool convert(const TypeCode *t, TIN o, TIN2 aux)
static double convert(const TypeCode *t, CORBA::Any *o, void *)
static double convert(const TypeCode *t, void *o, const TypeCode *intype)
static double convert(const TypeCode *t, YACS::ENGINE::Any *o, void *)
static double convert(const TypeCode *t, PyObject *o, void *)
static double convert(const TypeCode *t, xmlDocPtr doc, xmlNodePtr cur)
Basic template convertor from type TIN to Yacs<TOUT> type.
static double convert(const TypeCode *t, TIN o, TIN2 aux)
static long convert(const TypeCode *t, CORBA::Any *o, void *)
static long convert(const TypeCode *t, void *o, const TypeCode *intype)
static long convert(const TypeCode *t, YACS::ENGINE::Any *o, void *)
static long convert(const TypeCode *t, PyObject *o, void *)
static long convert(const TypeCode *t, xmlDocPtr doc, xmlNodePtr cur)
static long convert(const TypeCode *t, TIN o, TIN2 aux)
static std::string convert(const TypeCode *t, CORBA::Any *o, void *, int protocol)
static std::string convert(const TypeCode *t, YACS::ENGINE::Any *o, void *, int protocol)
static std::string convert(const TypeCode *t, PyObject *o, void *, int protocol)
static std::string convert(const TypeCode *t, xmlDocPtr doc, xmlNodePtr cur, int protocol)
static std::string convert(const TypeCode *t, TIN o, TIN2 aux, int protocol)
static void convert(const TypeCode *t, CORBA::Any *o, void *, std::vector< TOUT > &v)
static void convert(const TypeCode *t, YACS::ENGINE::Any *o, void *, std::vector< TOUT > &v)
static void convert(const TypeCode *t, PyObject *o, void *, std::vector< TOUT > &v)
static void convert(const TypeCode *t, xmlDocPtr doc, xmlNodePtr cur, std::vector< TOUT > &v)
static void convert(const TypeCode *t, TIN o, TIN2 aux, std::vector< TOUT > &v)
static std::string convert(const TypeCode *t, CORBA::Any *o, void *)
static std::string convert(const TypeCode *t, YACS::ENGINE::Any *o, void *)
static std::string convert(const TypeCode *t, PyObject *o, void *)
static std::string convert(const TypeCode *t, xmlDocPtr doc, xmlNodePtr cur)
static std::string convert(const TypeCode *t, TIN o, TIN2 aux)
static void convert(const TypeCode *t, CORBA::Any *o, void *, std::map< std::string, TOUT > &m)
static void convert(const TypeCode *t, YACS::ENGINE::Any *o, void *, std::map< std::string, TOUT > &m)
static void convert(const TypeCode *t, PyObject *o, void *, std::map< std::string, TOUT > &m)
static void convert(const TypeCode *t, xmlDocPtr doc, xmlNodePtr cur, std::map< std::string, TOUT > &m)
static void convert(const TypeCode *t, TIN o, TIN2 aux, std::map< std::string, TOUT > &v)
static int apply(const TypeCode *t1, const TypeCode *t2)
static int apply(const TypeCode *t1, const TypeCode *t2)
static int apply(const TypeCode *t1, const TypeCode *t2)
static int apply(const TypeCode *t1, const TypeCode *t2)
static int apply(const TypeCode *t1, const TypeCode *t2)
static int apply(const TypeCode *t1, const TypeCode *t2)
static int apply(const TypeCode *t1, const TypeCode *t2)
static int apply(const TypeCode *t1, const TypeCode *t2)