Salome HOME
Join modifications from branch OCC_debug_for_3_2_0b1
[modules/gui.git] / src / Session / Session_ServerThread.hxx
1 //  SALOME Session : implementation of Session_ServerThread.hxx
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
6 //  This library is free software; you can redistribute it and/or 
7 //  modify it under the terms of the GNU Lesser General Public 
8 //  License as published by the Free Software Foundation; either 
9 //  version 2.1 of the License. 
10 // 
11 //  This library is distributed in the hope that it will be useful, 
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
14 //  Lesser General Public License for more details. 
15 // 
16 //  You should have received a copy of the GNU Lesser General Public 
17 //  License along with this library; if not, write to the Free Software 
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : Session_ServerThread.hxx
25 //  Author : Paul RASCLE, EDF
26 //  Module : SALOME
27 //  $Header$
28
29 #ifndef _SESSION_SERVERTHREAD_HXX_
30 #define _SESSION_SERVERTHREAD_HXX_
31
32 #include <CORBA.h> 
33 #include <string>
34
35 #include "SALOME_NamingService.hxx"
36 #include <qthread.h>
37
38 using namespace std;
39
40 void WaitForServerReadiness(string serverName);
41
42
43 class Session_ServerThread
44 {
45 public:
46   static const int NB_SRV_TYP;
47   static const char* _serverTypes[];
48
49   Session_ServerThread();
50   Session_ServerThread(int argc,
51                        char ** argv, 
52                        CORBA::ORB_ptr orb, 
53                        PortableServer::POA_ptr poa);
54   virtual ~Session_ServerThread();
55   void         Init();
56 protected:
57   void         ActivateModuleCatalog   ( int argc, char ** argv );
58   void         ActivateSALOMEDS        ( int argc, char ** argv );
59   void         ActivateRegistry        ( int argc, char ** argv );
60   void         ActivateContainer       ( int argc, char ** argv );
61   virtual void ActivateSession         ( int argc, char ** argv );
62   void         ActivateEngine          ( int argc, char ** argv );
63   void         ActivateContainerManager( int argc, char ** argv );
64 protected:
65   int                     _argc;
66   char **                 _argv;
67   int                     _servType;
68   CORBA::ORB_var          _orb;
69   PortableServer::POA_var _root_poa;
70   SALOME_NamingService *  _NS;
71 };
72
73
74 class Session_SessionThread : public Session_ServerThread
75 {
76 public:
77   Session_SessionThread() {}
78   Session_SessionThread(int argc,
79                        char** argv, 
80                        CORBA::ORB_ptr orb, 
81                        PortableServer::POA_ptr poa,
82                        QMutex* GUIMutex,
83                        QWaitCondition* GUILauncher);
84   virtual ~Session_SessionThread();  
85
86 protected:
87   virtual void ActivateSession       ( int argc, char ** argv );
88 private:
89   QMutex*                 _GUIMutex;
90   QWaitCondition*         _GUILauncher;
91 };
92
93 #endif
94