#include "SMeshHelper.h"
-#include "SMESH_Gen_No_Session_i.hxx"
-#include "SALOME_Container_i.hxx"
#include "SALOME_KernelServices.hxx"
+#include "SMESH_Component_Generator.hxx"
+
#include <cstring>
std::string BuildSMESHInstanceInternal()
{
- CORBA::ORB_var orb;
- { int argc(0); orb = CORBA::ORB_init(argc,nullptr); }
- CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
- PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);
- PortableServer::POAManager_var pman = poa->the_POAManager();
- PortableServer::ObjectId_var conId;
- //
- {
- char *argv[4] = {"Container","FactoryServer","SMESH",nullptr};
- Engines_Container_i *cont = new Engines_Container_i(orb,poa,"FactoryServer",2,argv,false,false);
- conId = poa->activate_object(cont);
- }
- //
- pman->activate();
- //
- SMESH_Gen_No_Session_i *servant = new SMESH_Gen_No_Session_i(orb,poa,const_cast<PortableServer::ObjectId*>(&conId.in()),"SMESH_inst_2","SMESH");
- PortableServer::ObjectId *zeId = servant->getId();
- CORBA::Object_var zeRef = poa->id_to_reference(*zeId);
- CORBA::String_var ior = orb->object_to_string(zeRef);
- return std::string(ior.in());
+ Engines::EngineComponent_var zeRef = RetrieveSMESHInstance();
+ CORBA::String_var ior = KERNEL::getORB()->object_to_string(zeRef);
+ return std::string(ior.in());
}