34 using namespace YACS::ENGINE;
54 std::map<SALOME_ModuleCatalog::DataStreamType,std::string> datastreamMap;
68 CORBA::String_var componame = compo->componentname();
70 DEBTRACE(
"Implementation type : " << compo->implementation_type());
73 if(imptyp == SALOME_ModuleCatalog::SO)
DEBTRACE(
"Dyn lib");
74 if(imptyp == SALOME_ModuleCatalog::PY)
DEBTRACE(
"Python module");
75 if(imptyp == SALOME_ModuleCatalog::EXE)
DEBTRACE(
"Executable");
76 DEBTRACE(
"Implementation name : " << compo->implementation_name());
79 SALOME_ModuleCatalog::ListOfInterfaces_var interfacename_list = compo->GetInterfaceList();
80 if(interfacename_list->length() == 0)
83 for (
int j = 0; j < interfacename_list->length();j++)
85 DEBTRACE (
"Interface : " << interfacename_list[j]);
86 if(strcmp(componame,interfacename_list[j]) == 0)
92 DEBTRACE (
"Interface found : " << interfacename_list[found]);
95 SALOME_ModuleCatalog::DefinitionInterface_var interface;
96 interface= compo->GetInterface(interfacename_list[found]);
97 SALOME_ModuleCatalog::ListOfInterfaceService services = interface->interfaceservicelist;
98 for (
int k = 0; k < services.length(); k++)
100 DEBTRACE(
"Service : " << services[k].ServiceName);
101 const char* s=services[k].ServiceName;
104 node->
setRef((
const char*)componame);
106 for (
int kk=0;kk< services[k].ServiceinParameter.length();kk++)
108 DEBTRACE(
"Parameter : " << services[k].ServiceinParameter[kk].Parametername);
109 DEBTRACE(
"Type : " << services[k].ServiceinParameter[kk].Parametertype);
110 const char* ty=services[k].ServiceinParameter[kk].Parametertype;
113 std::stringstream msg;
114 msg <<
"Type " <<ty <<
" does not exist. Service " << s <<
" of component " << componame <<
" is not available";
116 std::cerr << msg.str() << std::endl;
117 compodef->
_serviceMap[s+std::string(
"_IS_INVALID")]=0;
122 const char* name=services[k].ServiceinParameter[kk].Parametername;
125 if(node == 0)
continue;
127 for (
int kk=0;kk< services[k].ServiceoutParameter.length();kk++)
129 DEBTRACE(
"Parameter : " << services[k].ServiceoutParameter[kk].Parametername);
130 DEBTRACE(
"Type : " << services[k].ServiceoutParameter[kk].Parametertype);
131 const char* ty=services[k].ServiceoutParameter[kk].Parametertype;
134 std::stringstream msg;
135 msg <<
"Type " <<ty <<
" does not exist. Service " << s <<
" of component " << componame <<
" is not available";
137 std::cerr << msg.str() << std::endl;
138 compodef->
_serviceMap[s+std::string(
"_IS_INVALID")]=0;
143 const char* name=services[k].ServiceoutParameter[kk].Parametername;
146 if(node == 0)
continue;
148 for (
int kk=0;kk< services[k].ServiceinDataStreamParameter.length();kk++)
150 DEBTRACE(
"Parameter : " << services[k].ServiceinDataStreamParameter[kk].Parametername);
151 DEBTRACE(
"Type : " << services[k].ServiceinDataStreamParameter[kk].Parametertype);
152 DEBTRACE(
"Dependency : " << services[k].ServiceinDataStreamParameter[kk].Parameterdependency);
154 const char* ty=services[k].ServiceinDataStreamParameter[kk].Parametertype;
156 std::string ty=datastreamMap[services[k].ServiceinDataStreamParameter[kk].Parametertype];
160 std::stringstream msg;
161 msg <<
"Type " <<ty <<
" does not exist. Service " << s <<
" of component " << componame <<
" is not available";
163 std::cerr << msg.str() << std::endl;
164 compodef->
_serviceMap[s+std::string(
"_IS_INVALID")]=0;
169 const char* name=services[k].ServiceinDataStreamParameter[kk].Parametername;
173 if(node == 0)
continue;
175 for (
int kk=0;kk< services[k].ServiceoutDataStreamParameter.length();kk++)
177 DEBTRACE(
"Parameter : " << services[k].ServiceoutDataStreamParameter[kk].Parametername);
178 DEBTRACE(
"Type : " << services[k].ServiceoutDataStreamParameter[kk].Parametertype);
179 DEBTRACE(
"Dependency : " << services[k].ServiceoutDataStreamParameter[kk].Parameterdependency);
181 const char* ty=services[k].ServiceoutDataStreamParameter[kk].Parametertype;
183 std::string ty=datastreamMap[services[k].ServiceoutDataStreamParameter[kk].Parametertype];
187 std::stringstream msg;
188 msg <<
"Type " <<ty <<
" does not exist. Service " << s <<
" of component " << componame <<
" is not available";
190 std::cerr << msg.str() << std::endl;
191 compodef->
_serviceMap[s+std::string(
"_IS_INVALID")]=0;
196 const char* name=services[k].ServiceoutDataStreamParameter[kk].Parametername;
206 if(node == 0)
continue;
225 DEBTRACE (
"SessionCataLoader::~SessionCataLoader");
231 std::map<std::string,TypeCode*>& typeMap=cata->
_typeMap;
233 SALOME_ModuleCatalog::ListOfTypeDefinition_var types_list=catalog->GetTypes();
234 for (
int i=0;
i< types_list->length();
i++)
236 const char* name=types_list[
i].name;
237 DEBTRACE (
"type : " << types_list[
i].name <<
" " << types_list[
i].kind);
238 if(types_list[
i].kind == SALOME_ModuleCatalog::Dble)
253 else if(types_list[
i].kind == SALOME_ModuleCatalog::Str)
258 else if(types_list[
i].kind == SALOME_ModuleCatalog::Seq)
260 const char* content=types_list[
i].content;
261 if ( typeMap.find(content) != typeMap.end() )
271 std::list<TypeCodeObjref *> ltc;
272 const char*
id=types_list[
i].
id;
273 for (
int m=0;
m< types_list[
i].bases.length();
m++)
275 const char* b_name=types_list[
i].bases[
m];
276 if(typeMap.find(b_name) != typeMap.end())
282 else if(types_list[
i].kind == SALOME_ModuleCatalog::Struc)
285 for (
int m=0;
m< types_list[
i].members.length();
m++)
287 const char* m_name=types_list[
i].members[
m].
name;
288 const char* m_type=types_list[
i].members[
m].type;
289 if(typeMap.find(m_type) != typeMap.end())
297 std::cerr <<
"Unknown kind: " << types_list[
i].kind << std::endl;
306 std::map<std::string,TypeCode*>& typeMap=cata->
_typeMap;
310 if(typeMap.count(
"CALCIUM_double")!=0)
312 typeMap[
"DOUBLE"]=typeMap[
"CALCIUM_double"];
313 typeMap[
"DOUBLE"]->incrRef();
315 if(typeMap.count(
"CALCIUM_real")!=0)
317 typeMap[
"FLOAT"]=typeMap[
"CALCIUM_real"];
318 typeMap[
"FLOAT"]->incrRef();
320 if(typeMap.count(
"CALCIUM_integer")!=0)
322 typeMap[
"INTEGER"]=typeMap[
"CALCIUM_integer"];
323 typeMap[
"INTEGER"]->incrRef();
325 if(typeMap.count(
"CALCIUM_boolean")!=0)
327 typeMap[
"BOOLEAN"]=typeMap[
"CALCIUM_boolean"];
328 typeMap[
"BOOLEAN"]->incrRef();
330 if(typeMap.count(
"CALCIUM_string")!=0)
332 typeMap[
"STRING"]=typeMap[
"CALCIUM_string"];
333 typeMap[
"STRING"]->incrRef();
385 datastreamMap[SALOME_ModuleCatalog::DATASTREAM_UNKNOWN]=
"CALCIUM_unknown";
386 datastreamMap[SALOME_ModuleCatalog::DATASTREAM_INTEGER]=
"CALCIUM_integer";
387 datastreamMap[SALOME_ModuleCatalog::DATASTREAM_FLOAT]=
"CALCIUM_real";
388 datastreamMap[SALOME_ModuleCatalog::DATASTREAM_DOUBLE]=
"CALCIUM_double";
389 datastreamMap[SALOME_ModuleCatalog::DATASTREAM_BOOLEAN]=
"CALCIUM_boolean";
390 datastreamMap[SALOME_ModuleCatalog::DATASTREAM_STRING]=
"CALCIUM_string";
394 CORBA::Object_var obj;
395 SALOME_ModuleCatalog::ModuleCatalog_var catalog;
396 obj=orb->string_to_object(
_path.c_str());
397 catalog= SALOME_ModuleCatalog::ModuleCatalog::_narrow(obj);
406 SALOME_ModuleCatalog::ListOfComponents_var componentname_list;
407 componentname_list = catalog->GetComponentList();
408 for (
int i=0;
i<componentname_list->length();
i++)
410 DEBTRACE (
"Component : " << componentname_list[
i]);
411 SALOME_ModuleCatalog::Acomponent_var component = catalog->GetComponent(componentname_list[i]);