#include "GaudiKernel/SmartIF.h"#include "GaudiKernel/Bootstrap.h"#include "GaudiKernel/IAppMgrUI.h"#include "GaudiKernel/IProperty.h"#include "GaudiKernel/StatusCode.h"#include <iostream>Include dependency graph for GaudiMain.cpp:
Go to the source code of this file.
Functions | |
| int | main (int argc, char **argv) |
| int main | ( | int | argc, | |
| char ** | argv | |||
| ) |
Definition at line 19 of file GaudiMain.cpp.
00019 { 00020 // Create an instance of an application manager 00021 IInterface* iface = Gaudi::createApplicationMgr(); 00022 SmartIF<IProperty> propMgr ( iface ); 00023 SmartIF<IAppMgrUI> appMgr ( iface ); 00024 00025 if( !appMgr.isValid() || !propMgr.isValid() ) { 00026 std::cout << "Fatal error while creating the ApplicationMgr " << std::endl; 00027 return 1; 00028 } 00029 00030 // Get the input configuration file from arguments 00031 std:: string opts = (argc>1) ? argv[1] : ""; 00032 00033 propMgr->setProperty( "JobOptionsPath", opts ); 00034 00035 // Set the program name and version using macros defined in compilation flags 00036 #if defined APPNAME 00037 propMgr->setProperty( "AppName", APPNAME ); 00038 #endif 00039 #if defined APPVERS 00040 propMgr->setProperty( "AppVersion", APPVERS ); 00041 #endif 00042 00043 if( opts != "" && opts.substr( opts.length() - 3, 3 ) == ".py" ) { 00044 propMgr->setProperty( "EvtSel", "NONE" ); 00045 propMgr->setProperty( "JobOptionsType", "NONE" ); 00046 propMgr->setProperty( "DLLs", "['GaudiPython']" ); 00047 propMgr->setProperty( "Runable", "PythonScriptingSvc" ); 00048 } 00049 00050 // Run the application manager and process events 00051 StatusCode sc=appMgr->run(); 00052 00053 // Release Application Manager 00054 iface->release(); 00055 00056 // All done - exit 00057 return (sc==StatusCode::SUCCESS)?0:1; 00058 }
1.4.7