Version: 9.16.0
Session_ServerThread.hxx
Go to the documentation of this file.
1// Copyright (C) 2007-2026 CEA, EDF, 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, or (at your option) any later version.
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// SALOME Session : implementation of Session_ServerThread.hxx
24// File : Session_ServerThread.hxx
25// Author : Paul RASCLE, EDF
26
27#ifndef _SESSION_SERVERTHREAD_HXX_
28#define _SESSION_SERVERTHREAD_HXX_
29
31#include "SALOME_Session.hxx"
32
33#include <omniORB4/CORBA.h>
34#include <string>
35#include <memory>
36
37void WaitForServerReadiness(std::string serverName);
38
39class SALOME_NamingService;
40class Abstract_Engines_Container_i;
41
42template<class MY_NS>
44{
45public:
46 using RealNS = typename MY_NS::RealNS;
47public:
48 static const int NB_SRV_TYP;
49 static const char* _serverTypes[];
50
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 void Shutdown();
59protected:
60 void ActivateModuleCatalog ( int argc, char ** argv );
61 void ActivateSALOMEDS ( int argc, char ** argv );
62 void ActivateRegistry ( int argc, char ** argv );
63 void ActivateContainer ( int argc, char ** argv );
64 virtual void ActivateSession ( int argc, char ** argv );
65 void ActivateEngine ( int argc, char ** argv );
66 void ActivateContainerManager( int argc, char ** argv );
67 RealNS *getNS();
68protected:
69 int _argc;
70 char ** _argv;
72 CORBA::ORB_var _orb;
73 PortableServer::POA_var _root_poa;
74 std::unique_ptr<MY_NS> _NS;
75 Abstract_Engines_Container_i* _container;
76};
77
78class QMutex;
79class QWaitCondition;
80
81template<class MY_NS>
83{
84public:
86 Session_SessionThread(int argc,
87 char** argv,
88 CORBA::ORB_ptr orb,
89 PortableServer::POA_ptr poa,
90 QMutex* GUIMutex,
91 QWaitCondition* GUILauncher);
92 virtual ~Session_SessionThread();
93
94protected:
95 void ActivateSession ( int argc, char ** argv ) override;
96private:
97 QMutex* _GUIMutex;
98 QWaitCondition* _GUILauncher;
99};
100
101#endif
#define SESSION_EXPORT
Definition: SALOME_Session.hxx:37
void WaitForServerReadiness(std::string serverName)
Definition: Session_ServerThread.hxx:44
int _argc
Definition: Session_ServerThread.hxx:69
std::unique_ptr< MY_NS > _NS
Definition: Session_ServerThread.hxx:74
int _servType
Definition: Session_ServerThread.hxx:71
void ActivateEngine(int argc, char **argv)
typename MY_NS::RealNS RealNS
Definition: Session_ServerThread.hxx:46
char ** _argv
Definition: Session_ServerThread.hxx:70
Abstract_Engines_Container_i * _container
Definition: Session_ServerThread.hxx:75
static const int NB_SRV_TYP
Definition: Session_ServerThread.hxx:48
PortableServer::POA_var _root_poa
Definition: Session_ServerThread.hxx:73
CORBA::ORB_var _orb
Definition: Session_ServerThread.hxx:72
Definition: Session_ServerThread.hxx:83
QWaitCondition * _GUILauncher
Definition: Session_ServerThread.hxx:98
QMutex * _GUIMutex
Definition: Session_ServerThread.hxx:97
Session_SessionThread()
Definition: Session_ServerThread.hxx:85