Salome HOME
add method NameChanged to update title name
[modules/kernel.git] / src / KernelHelpers / SALOME_KernelServices.hxx
index 4970858cf0deb216e3d7e061ea140db2952d7653..9496986b10327694c69746d89631d204db97ce2c 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -26,7 +26,7 @@
 #include "SALOMEconfig.h"
 #include CORBA_SERVER_HEADER(SALOMEDS)
 #include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-#include CORBA_SERVER_HEADER(SALOME_ContainerManager)
+#include CORBA_SERVER_HEADER(SALOME_Launcher)
 #include CORBA_CLIENT_HEADER(SALOME_Session)
 #include CORBA_SERVER_HEADER(SALOME_Exception)
 
@@ -41,7 +41,7 @@ namespace KERNEL {
   KERNELHELPERS_EXPORT SALOME_NamingService *        getNamingService();
   KERNELHELPERS_EXPORT SALOME_LifeCycleCORBA *       getLifeCycleCORBA();
   KERNELHELPERS_EXPORT SALOME::Session_ptr           getSalomeSession();
-  KERNELHELPERS_EXPORT SALOMEDS::StudyManager_ptr    getStudyManager();
+  KERNELHELPERS_EXPORT SALOMEDS::Study_ptr           getStudy();
   KERNELHELPERS_EXPORT Engines::SalomeLauncher_ptr   getSalomeLauncher();
   KERNELHELPERS_EXPORT Engines::ResourcesManager_ptr getResourcesManager();
 
@@ -49,8 +49,6 @@ namespace KERNEL {
   // SALOME KERNEL services to deal with a SALOME study, SObject and
   // SComponent.
   //
-  KERNELHELPERS_EXPORT SALOMEDS::Study_ptr getStudyById(int aStudyId);
-  KERNELHELPERS_EXPORT int                 getStudyId(SALOMEDS::Study_ptr study);
   KERNELHELPERS_EXPORT CORBA::Object_ptr   IORToObject(char * IOR);
   KERNELHELPERS_EXPORT CORBA::Object_ptr   SObjectToObject(SALOMEDS::SObject_ptr);
   
@@ -96,23 +94,8 @@ namespace KERNEL {
 #define SALOMELOG(msg) {MESS_BEGIN("[XSALOME]") << msg << MESS_END}
 #define LOG SALOMELOG
 
-// This can help to LOG (or use in stream) the CORBA exceptions
+#include "Utils_CorbaException.hxx"
+// Tip: CORBA exceptions can be used with LOG (or more generally in streams)
 // Ex: LOG("An exception occurs: "<<e) will log the data of the exception e
-#include <CORBA.h>
-#include <ostream>
-static std::ostream &
-operator<<(std::ostream & os, const CORBA::Exception & e)
-{
-  CORBA::Any tmp;
-  tmp <<=e ;
-  CORBA::TypeCode_var tc = tmp.type();
-  const char * p = tc->name ();
-  if (*p != '\0')
-    os << p;
-  else
-    os << tc->id();
-  return os;
-}
-
 
 #endif // KERNEL_SERVICES