Salome HOME
Initialisation de la base KERNEL avec la version operationnelle de KERNEL_SRC issue...
[modules/kernel.git] / src / Utils / Utils_ORB_INIT.cxx
1 using namespace std;
2 //=============================================================================
3 // File      : Utils_ORB_INIT.cxx
4 // Created   : lun nov  5 16:04:47 CET 2001
5 // Author    : Antoine YESSAYAN, EDF
6 // Project   : SALOME
7 // Copyright : EDF 2001
8 // $Header$
9 //=============================================================================
10
11 using namespace std;
12 # include "Utils_ORB_INIT.hxx" 
13 # include "utilities.h" 
14
15 ORB_INIT::ORB_INIT( void ): _orb( CORBA::ORB::_nil() )
16 {
17         ;
18 }
19
20
21 ORB_INIT::~ORB_INIT()
22 {
23         if ( ! CORBA::is_nil( _orb ) )
24         {
25                 MESSAGE("appel _orb->destroy()") ;
26                 _orb->destroy() ;
27                 MESSAGE("retour _orb->destroy()") ;
28         }
29 }
30
31
32 CORBA::ORB_var &ORB_INIT::operator() ( int argc , char **argv ) throw( CommException )
33 {
34         if ( CORBA::is_nil( _orb ) )
35         {
36                 try
37                 {
38                         _orb = CORBA::ORB_init( argc , argv ) ;
39                         //set GIOP message size equal to 50Mb for transferring brep shapes as 
40                         //sequence of bytes using C++ streams
41                         omniORB::MaxMessageSize(100*1024*1024);
42                 }
43                 catch( const CORBA::Exception &ex )
44                 {
45                         throw CommException( "Unable to create an ORB connexion" ) ;
46                 }
47         }
48         return _orb ;
49 }