-// Copyright (C) 2010-2015 CEA/DEN, EDF R&D
+// Copyright (C) 2015-2024 CEA, EDF, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#ifndef PVSERVERSERVICELOADER_H_
#define PVSERVERSERVICELOADER_H_
-#include "PVServerService.h"
-
-#include <SALOME_ContainerManager.hxx>
+#include "PVServerServiceLoader.h"
+#include "SALOME_Fake_NamingService.hxx"
+#include <SALOMEconfig.h>
+#include CORBA_CLIENT_HEADER(SALOME_Component)
+#include <string>
+#include <exception>
+#include <memory>
class SALOME_LifeCycleCORBA;
-class SALOME_NamingService;
-class PVSERVERSERVICE_EXPORT PVServer_ServiceLoader
+class PVSERVERSERVICELOADER_EXPORT PVServer_ServiceLoader_Exception: public std::exception
{
public:
- PVServer_ServiceLoader();
+ PVServer_ServiceLoader_Exception(const std::string & what):_what(what) {}
+ ~PVServer_ServiceLoader_Exception() noexcept {}
+ virtual const char* what() const noexcept { return _what.c_str(); }
+private:
+ std::string _what;
+};
+
+class PVSERVERSERVICELOADER_EXPORT PVServer_ServiceLoader
+{
+public:
+ PVServer_ServiceLoader() ;
virtual ~PVServer_ServiceLoader();
//! Get the IOR of the CORBA service handling the PVServer
- std::string findOrLoadService(const char * containerName);
+ std::string findOrLoadService( const std::string& );
private:
- std::string findService(const char * containerName);
- std::string loadService(const char * containerName);
+ SALOME_LifeCycleCORBA* lcc();
+ std::string findService( const std::string& );
+ std::string loadService( const std::string& );
+ Engines::Container_ptr getContainer( const std::string&, const std::string& );
- SALOME_LifeCycleCORBA * _lcc;
- CORBA::ORB_ptr _orb;
- SALOME_NamingService * _ns;
- Engines::ContainerManager_ptr _cm;
+private:
+ SALOME_LifeCycleCORBA* myLcc;
+ std::unique_ptr<SALOME_Fake_NamingService> mySSLNS;
};
#endif /* PVSERVERSERVICELOADER_H_ */