Salome HOME
Merge from V6_main 01/04/2013
[modules/gui.git] / src / Session / Session_ServerLauncher.hxx
index 7c97199fee1a3eed666c5a7b1c31477361f3f9fe..d2b24640957ff4e0a91685b703fa2b291dc851f2 100755 (executable)
@@ -1,53 +1,41 @@
-//  SALOME Session : implementation of Session_ServerLauncher.hxx
+// Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  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. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
+//  SALOME Session : implementation of Session_ServerLauncher.hxx
 //  File   : Session_ServerLauncher.hxx
 //  Author : Paul RASCLE, EDF
-//  Module : SALOME
-//  $Header$
 
 #ifndef _SESSION_SERVERLAUNCHER_HXX_
 #define _SESSION_SERVERLAUNCHER_HXX_
 
-#include "Session_ServerThread.hxx"
+#include "SALOME_Session.hxx"
 
-#include <CORBA.h> 
+#include <omniORB4/CORBA.h> 
 #include <list>
 #include <vector>
 #include <string>
-#include <qthread.h>
-#include <qwaitcondition.h>
-
+#include <QThread>
 
-#ifdef WNT
-#include <SALOME_WNT.hxx>
-#else
-#define SALOME_WNT_EXPORT
-#endif
-
-using namespace std;
-
-class ServArg
+class SESSION_EXPORT ServArg
   {
   public:
     int _servType;
@@ -60,20 +48,26 @@ inline ServArg::ServArg(int servType, int firstArg, int lastArg):
   _servType(servType),_firstArg(firstArg),_lastArg(lastArg)
 {}
 
-class SALOME_WNT_EXPORT Session_ServerLauncher: public QThread
+class Session_ServerThread;
+
+class QMutex;
+class QWaitCondition;
+
+class SESSION_EXPORT Session_ServerLauncher: public QThread
 {
 public:
   Session_ServerLauncher();
   Session_ServerLauncher(int argc,
-                        char ** argv, 
-                        CORBA::ORB_ptr orb, 
-                        PortableServer::POA_ptr poa,
-                        QMutex *GUIMutex,
-                        QWaitCondition *ServerLaunch,
-                        QMutex *SessionMutex,
-                        QWaitCondition *SessionStarted);
+                         char ** argv, 
+                         CORBA::ORB_ptr orb, 
+                         PortableServer::POA_ptr poa,
+                         QMutex *GUIMutex,
+                         QWaitCondition *ServerLaunch,
+                         QMutex *SessionMutex,
+                         QWaitCondition *SessionStarted);
   virtual ~Session_ServerLauncher();
   void run();
+  void ShutdownAll();
   void KillAll();
 
 protected:
@@ -81,17 +75,17 @@ protected:
   void ActivateAll();
 
 private:
-  int _argc;
-  char ** _argv;
-  CORBA::ORB_var              _orb;
-  PortableServer::POA_var     _root_poa;
-  QMutex*                     _GUIMutex;
-  QWaitCondition*             _ServerLaunch;
-  QMutex*                     _SessionMutex;
-  QWaitCondition*             _SessionStarted;
-  list<ServArg>               _argServToLaunch;
-  vector<string>              _argCopy;
-  list<Session_ServerThread*> _serverThreads;
+  int                              _argc;
+  char**                           _argv;
+  CORBA::ORB_var                    _orb;
+  PortableServer::POA_var          _root_poa;
+  QMutex*                          _GUIMutex;
+  QWaitCondition*                  _ServerLaunch;
+  QMutex*                          _SessionMutex;
+  QWaitCondition*                  _SessionStarted;
+  std::list<ServArg>               _argServToLaunch;
+  std::vector<std::string>         _argCopy;
+  std::list<Session_ServerThread*> _serverThreads;
 };
 
 #endif