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
22 #include "SALOME_NamingService_Abstract.hxx"
23 #include "BL_Engine.hxx"
28 * Decorator class that allows JobManager engine to switch between :
29 * - NamingService CORBA server (SALOME_NamingService)
30 * - NamingService embedded (SALOME_Fake_NamingService)
32 class BL_Engine_EXPORT BL_SALOME_NamingService_Wrapper : public SALOME_NamingService_Abstract
35 BL_SALOME_NamingService_Wrapper();
36 BL_SALOME_NamingService_Wrapper(CORBA::ORB_ptr orb);
37 std::vector< std::string > repr() override { return _effective_ns->repr(); }
38 void init_orb(CORBA::ORB_ptr orb=0) override { _effective_ns->init_orb(orb); }
39 bool IsTrueNS() const override { return _effective_ns->IsTrueNS(); }
40 void Register(CORBA::Object_ptr ObjRef, const char* Path) override { _effective_ns->Register(ObjRef,Path); }
41 CORBA::Object_ptr Resolve(const char* Path) override { return _effective_ns->Resolve(Path); }
42 CORBA::Object_ptr ResolveFirst(const char* Path) override { return _effective_ns->ResolveFirst(Path); }
43 void Destroy_Name(const char* Path) override { _effective_ns->Destroy_Name(Path); }
44 void Destroy_Directory(const char* Path) override { _effective_ns->Destroy_Directory(Path); }
45 void Destroy_FullDirectory(const char* Path) override { _effective_ns->Destroy_FullDirectory(Path); }
46 bool Change_Directory(const char* Path) override { return _effective_ns->Change_Directory(Path); }
47 std::vector<std::string> list_subdirs() override { return _effective_ns->list_directory(); }
48 std::vector<std::string> list_directory() override { return _effective_ns->list_directory(); }
49 std::vector<std::string> list_directory_recurs() override { return _effective_ns->list_directory_recurs(); }
50 SALOME_NamingService_Abstract *clone() override { return new BL_SALOME_NamingService_Wrapper(*this); }
51 CORBA::Object_ptr ResolveComponent(const char* hostname, const char* containerName, const char* componentName, const int nbproc=0) override { return _effective_ns->ResolveComponent(hostname,containerName,componentName,nbproc); }
53 BL_SALOME_NamingService_Wrapper(const BL_SALOME_NamingService_Wrapper& other);
54 void initializeEffectiveNS();
56 std::unique_ptr<SALOME_NamingService_Abstract> _effective_ns;