#include "GaudiKernel/SmartIF.h"
#include "GaudiKernel/Bootstrap.h"
#include "GaudiKernel/IAppMgrUI.h"
#include "GaudiKernel/IProperty.h"
#include "GaudiKernel/Property.h"
#include "GaudiKernel/StatusCode.h"
#include <iostream>
Go to the source code of this file.
Functions |
| GAUDI_API int | GaudiMain (int argc, char **argv) |
Function Documentation
| GAUDI_API int GaudiMain |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 15 of file GaudiMain.cpp.
{
IInterface* iface = Gaudi::createApplicationMgr();
SmartIF<IProperty> propMgr ( iface );
SmartIF<IAppMgrUI> appMgr ( iface );
if( !appMgr.isValid() || !propMgr.isValid() ) {
std::cout << "Fatal error while creating the ApplicationMgr " << std::endl;
return 1;
}
std:: string opts = (argc>1) ? argv[1] : "jobOptions.txt";
propMgr->setProperty( "JobOptionsPath", opts ).ignore();
if( opts.substr( opts.length() - 3, 3 ) == ".py" ) {
propMgr->setProperty( "EvtSel", "NONE" ).ignore();
propMgr->setProperty( "JobOptionsType", "NONE" ).ignore();
propMgr->setProperty( "DLLs", "['GaudiPython']" ).ignore();
propMgr->setProperty( "Runable", "PythonScriptingSvc" ).ignore();
}
StatusCode sc = appMgr->run();
IntegerProperty returnCode("ReturnCode", 0);
propMgr->getProperty(&returnCode).ignore();
iface->release();
if (sc.isFailure() && returnCode.value() == 0) {
returnCode.setValue(1);
}
return returnCode.value();
}