Version: 6.3.1

src/Session/Session_ServerLauncher.hxx

Go to the documentation of this file.
00001 // Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  SALOME Session : implementation of Session_ServerLauncher.hxx
00024 //  File   : Session_ServerLauncher.hxx
00025 //  Author : Paul RASCLE, EDF
00026 //  Module : SALOME
00027 //  $Header: /home/server/cvs/GUI/GUI_SRC/src/Session/Session_ServerLauncher.hxx,v 1.7.2.1.8.1.12.1 2011-06-01 13:53:42 vsr Exp $
00028 //
00029 #ifndef _SESSION_SERVERLAUNCHER_HXX_
00030 #define _SESSION_SERVERLAUNCHER_HXX_
00031 
00032 #include "SALOME_Session.hxx"
00033 
00034 #include <CORBA.h> 
00035 #include <list>
00036 #include <vector>
00037 #include <string>
00038 #include <QThread>
00039 
00040 using namespace std;
00041 
00042 class SESSION_EXPORT ServArg
00043   {
00044   public:
00045     int _servType;
00046     int _firstArg;
00047     int _lastArg;
00048     inline ServArg(int servType=0, int firstArg=0, int lastArg=0);
00049 };
00050 
00051 inline ServArg::ServArg(int servType, int firstArg, int lastArg):
00052   _servType(servType),_firstArg(firstArg),_lastArg(lastArg)
00053 {}
00054 
00055 class Session_ServerThread;
00056 
00057 class QMutex;
00058 class QWaitCondition;
00059 
00060 class SESSION_EXPORT Session_ServerLauncher: public QThread
00061 {
00062 public:
00063   Session_ServerLauncher();
00064   Session_ServerLauncher(int argc,
00065                          char ** argv, 
00066                          CORBA::ORB_ptr orb, 
00067                          PortableServer::POA_ptr poa,
00068                          QMutex *GUIMutex,
00069                          QWaitCondition *ServerLaunch,
00070                          QMutex *SessionMutex,
00071                          QWaitCondition *SessionStarted);
00072   virtual ~Session_ServerLauncher();
00073   void run();
00074   void KillAll();
00075 
00076 protected:
00077   void CheckArgs();
00078   void ActivateAll();
00079 
00080 private:
00081   int _argc;
00082   char ** _argv;
00083   CORBA::ORB_var              _orb;
00084   PortableServer::POA_var     _root_poa;
00085   QMutex*                     _GUIMutex;
00086   QWaitCondition*             _ServerLaunch;
00087   QMutex*                     _SessionMutex;
00088   QWaitCondition*             _SessionStarted;
00089   list<ServArg>               _argServToLaunch;
00090   vector<string>              _argCopy;
00091   list<Session_ServerThread*> _serverThreads;
00092 };
00093 
00094 #endif
00095 
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS