]> SALOME platform Git repositories - modules/gui.git/blob - src/Session/Session_ServerThread.hxx
Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[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.salome-platform.org/ or email : webmaster.salome@opencascade.com
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 <SALOME_Session.hxx>
33
34 #include <CORBA.h> 
35 #include <string>
36
37 #include "SALOME_NamingService.hxx"
38 #include <qthread.h>
39
40 using namespace std;
41
42 void WaitForServerReadiness(string serverName);
43
44
45 class SESSION_EXPORT Session_ServerThread
46 {
47 public:
48   static const int NB_SRV_TYP;
49   static const char* _serverTypes[];
50
51   Session_ServerThread();
52   Session_ServerThread(int argc,
53                        char ** argv, 
54                        CORBA::ORB_ptr orb, 
55                        PortableServer::POA_ptr poa);
56   virtual ~Session_ServerThread();
57   void         Init();
58 protected:
59   void         ActivateModuleCatalog   ( int argc, char ** argv );
60   void         ActivateSALOMEDS        ( int argc, char ** argv );
61   void         ActivateRegistry        ( int argc, char ** argv );
62   void         ActivateContainer       ( int argc, char ** argv );
63   virtual void ActivateSession         ( int argc, char ** argv );
64   void         ActivateEngine          ( int argc, char ** argv );
65   void         ActivateContainerManager( int argc, char ** argv );
66 protected:
67   int                     _argc;
68   char **                 _argv;
69   int                     _servType;
70   CORBA::ORB_var          _orb;
71   PortableServer::POA_var _root_poa;
72   SALOME_NamingService *  _NS;
73 };
74
75
76 class SESSION_EXPORT Session_SessionThread : public Session_ServerThread
77 {
78 public:
79   Session_SessionThread() {}
80   Session_SessionThread(int argc,
81                        char** argv, 
82                        CORBA::ORB_ptr orb, 
83                        PortableServer::POA_ptr poa,
84                        QMutex* GUIMutex,
85                        QWaitCondition* GUILauncher);
86   virtual ~Session_SessionThread();  
87
88 protected:
89   virtual void ActivateSession       ( int argc, char ** argv );
90 private:
91   QMutex*                 _GUIMutex;
92   QWaitCondition*         _GUILauncher;
93 };
94
95 #endif
96