1 // Copyright (C) 2007-2014 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 // Author : Guillaume Boulant (EDF)
22 #include "MEDOPFactoryClient.hxx"
23 #include "SALOME_KernelServices.hxx"
25 namespace MEDOPFactoryClient {
28 * This returns a singleton (static) instance of the XMED engine.
30 MEDOP::MEDOPFactory_ptr getFactory() {
31 static MEDOP::MEDOPFactory_ptr engine;
32 if(CORBA::is_nil(engine)){
33 Engines::EngineComponent_var component =
34 KERNEL::getLifeCycleCORBA()->FindOrLoad_Component( "FactoryServer","MEDOPFactory" );
35 engine = MEDOP::MEDOPFactory::_narrow(component);
41 * This returns a singleton (static) instance of the XMED data manager.
43 MEDOP::MEDDataManager_ptr getDataManager() {
44 static MEDOP::MEDDataManager_ptr dataManager;
45 if(CORBA::is_nil(dataManager)){
46 dataManager = getFactory()->getDataManager();
52 * This returns a singleton (static) instance of the XMED calculator.
54 MEDOP::MEDCalculator_ptr getCalculator() {
55 static MEDOP::MEDCalculator_ptr calculator;
56 if(CORBA::is_nil(calculator)){
57 calculator = getFactory()->getCalculator();