#include <utilities.h> // MESSAGE() macro
#include <SALOMEconfig.h>
#include CORBA_CLIENT_HEADER(SALOME_ContainerManager)
+#include <exception>
-PVServer_ServiceLoader::PVServer_ServiceLoader():
+PVServer_ServiceLoader::PVServer_ServiceLoader() throw(PVServer_ServiceLoader_Exception):
myLcc( 0 )
{
- myLcc = new SALOME_LifeCycleCORBA();
+ try
+ {
+ myLcc = new SALOME_LifeCycleCORBA();
+ }
+ catch(...)
+ {
+ throw PVServer_ServiceLoader_Exception("Unable to instanciate SALOME_LifeCycleCORBA!");
+ }
}
PVServer_ServiceLoader::~PVServer_ServiceLoader()
#include <SALOMEconfig.h>
#include CORBA_CLIENT_HEADER(SALOME_Component)
#include <string>
+#include <exception>
class SALOME_LifeCycleCORBA;
+class PVSERVERSERVICELOADER_EXPORT PVServer_ServiceLoader_Exception: public std::exception
+{
+public:
+ PVServer_ServiceLoader_Exception(const std::string & what):_what(what) {}
+ ~PVServer_ServiceLoader_Exception() throw () {}
+ virtual const char* what() const throw() { return _what.c_str(); }
+private:
+ std::string _what;
+};
+
class PVSERVERSERVICELOADER_EXPORT PVServer_ServiceLoader
{
public:
- PVServer_ServiceLoader();
+ PVServer_ServiceLoader() throw(PVServer_ServiceLoader_Exception);
virtual ~PVServer_ServiceLoader();
//! Get the IOR of the CORBA service handling the PVServer
%include <std_string.i>
+class PVServer_ServiceLoader_Exception
+{
+public:
+ PVServer_ServiceLoader_Exception(const std::string & what);
+};
+
class PVServer_ServiceLoader
{
public:
+ PVServer_ServiceLoader() throw(PVServer_ServiceLoader_Exception);
//! Get the IOR of the CORBA service handling the PVServer
std::string findOrLoadService(const std::string& containerName);
};