Back to index

salome-gui  6.5.0
Session_ServerThread.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  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_ServerThread.hxx
00024 //  File   : Session_ServerThread.hxx
00025 //  Author : Paul RASCLE, EDF
00026 
00027 #ifndef _SESSION_SERVERTHREAD_HXX_
00028 #define _SESSION_SERVERTHREAD_HXX_
00029 
00030 #include "SALOME_Session.hxx"
00031 
00032 #include <CORBA.h> 
00033 #include <string>
00034 
00035 void WaitForServerReadiness(std::string serverName);
00036 
00037 class SALOME_NamingService;
00038 
00039 class SESSION_EXPORT Session_ServerThread
00040 {
00041 public:
00042   static const int NB_SRV_TYP;
00043   static const char* _serverTypes[];
00044 
00045   Session_ServerThread();
00046   Session_ServerThread(int argc,
00047                        char ** argv, 
00048                        CORBA::ORB_ptr orb, 
00049                        PortableServer::POA_ptr poa);
00050   virtual ~Session_ServerThread();
00051   void         Init();
00052 protected:
00053   void         ActivateModuleCatalog   ( int argc, char ** argv );
00054   void         ActivateSALOMEDS        ( int argc, char ** argv );
00055   void         ActivateRegistry        ( int argc, char ** argv );
00056   void         ActivateContainer       ( int argc, char ** argv );
00057   virtual void ActivateSession         ( int argc, char ** argv );
00058   void         ActivateEngine          ( int argc, char ** argv );
00059   void         ActivateContainerManager( int argc, char ** argv );
00060 protected:
00061   int                     _argc;
00062   char **                 _argv;
00063   int                     _servType;
00064   CORBA::ORB_var          _orb;
00065   PortableServer::POA_var _root_poa;
00066   SALOME_NamingService *  _NS;
00067 };
00068 
00069 class QMutex;
00070 class QWaitCondition;
00071 
00072 class SESSION_EXPORT Session_SessionThread : public Session_ServerThread
00073 {
00074 public:
00075   Session_SessionThread() {}
00076   Session_SessionThread(int argc,
00077                      char** argv, 
00078                      CORBA::ORB_ptr orb, 
00079                      PortableServer::POA_ptr poa,
00080                      QMutex* GUIMutex,
00081                      QWaitCondition* GUILauncher);
00082   virtual ~Session_SessionThread();  
00083 
00084 protected:
00085   virtual void ActivateSession       ( int argc, char ** argv );
00086 private:
00087   QMutex*                 _GUIMutex;
00088   QWaitCondition*         _GUILauncher;
00089 };
00090 
00091 #endif
00092