1 // Copyright (C) 2021 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include "GEOM_Gen_Session_i.hh"
22 GEOM_Gen_Session_i::GEOM_Gen_Session_i(CORBA::ORB_ptr orb,
23 PortableServer::POA_ptr poa,
24 PortableServer::ObjectId *contId,
25 const char *instanceName,
26 const char *interfaceName):GEOM_Gen_i(orb,poa,contId,instanceName,interfaceName,true)
28 name_service = new SALOME_NamingService(_orb);
31 GEOM_Gen_Session_i::~GEOM_Gen_Session_i()
36 void GEOM_Gen_Session_i::register_name(char * name)
38 GEOM::GEOM_Gen_var g = _this();
39 name_service->Register(g, name);
42 SALOMEDS::Study_var GEOM_Gen_Session_i::getStudyServant()
44 static SALOMEDS::Study_var aStudy;
45 if(CORBA::is_nil(aStudy))
47 CORBA::Object_ptr anObject = name_service->Resolve("/Study");
48 aStudy = SALOMEDS::Study::_narrow(anObject);
55 GEOM_I_EXPORT PortableServer::ObjectId* GEOMEngine_factory(CORBA::ORB_ptr orb,
56 PortableServer::POA_ptr poa,
57 PortableServer::ObjectId* contId,
58 const char* instanceName,
59 const char* interfaceName)
61 GEOM_Gen_Session_i* myGEOM_Gen_i = new GEOM_Gen_Session_i(orb, poa, contId, instanceName, interfaceName);
62 return myGEOM_Gen_i->getId();