]> SALOME platform Git repositories - modules/gui.git/blob - src/Session/Session_ServerThread.hxx
Salome HOME
549dd3021bbdf94cf759dc28499ae167160e1991
[modules/gui.git] / src / Session / Session_ServerThread.hxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  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 //  SALOME Session : implementation of Session_ServerThread.hxx
23 //  File   : Session_ServerThread.hxx
24 //  Author : Paul RASCLE, EDF
25 //  Module : SALOME
26 //  $Header$
27 //
28 #ifndef _SESSION_SERVERTHREAD_HXX_
29 #define _SESSION_SERVERTHREAD_HXX_
30
31 #include "SALOME_Session.hxx"
32
33 #include <CORBA.h> 
34 #include <string>
35
36 using namespace std;
37
38 void WaitForServerReadiness(string serverName);
39
40 class SALOME_NamingService;
41
42 class SESSION_EXPORT Session_ServerThread
43 {
44 public:
45   static const int NB_SRV_TYP;
46   static const char* _serverTypes[];
47
48   Session_ServerThread();
49   Session_ServerThread(int argc,
50                        char ** argv, 
51                        CORBA::ORB_ptr orb, 
52                        PortableServer::POA_ptr poa);
53   virtual ~Session_ServerThread();
54   void         Init();
55 protected:
56   void         ActivateModuleCatalog   ( int argc, char ** argv );
57   void         ActivateSALOMEDS        ( int argc, char ** argv );
58   void         ActivateRegistry        ( int argc, char ** argv );
59   void         ActivateContainer       ( int argc, char ** argv );
60   virtual void ActivateSession         ( int argc, char ** argv );
61   void         ActivateEngine          ( int argc, char ** argv );
62   void         ActivateContainerManager( int argc, char ** argv );
63 protected:
64   int                     _argc;
65   char **                 _argv;
66   int                     _servType;
67   CORBA::ORB_var          _orb;
68   PortableServer::POA_var _root_poa;
69   SALOME_NamingService *  _NS;
70 };
71
72 class QMutex;
73 class QWaitCondition;
74
75 class SESSION_EXPORT Session_SessionThread : public Session_ServerThread
76 {
77 public:
78   Session_SessionThread() {}
79   Session_SessionThread(int argc,
80                        char** argv, 
81                        CORBA::ORB_ptr orb, 
82                        PortableServer::POA_ptr poa,
83                        QMutex* GUIMutex,
84                        QWaitCondition* GUILauncher);
85   virtual ~Session_SessionThread();  
86
87 protected:
88   virtual void ActivateSession       ( int argc, char ** argv );
89 private:
90   QMutex*                 _GUIMutex;
91   QWaitCondition*         _GUILauncher;
92 };
93
94 #endif
95