The Gaudi Framework
v25r3
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
GaudiMain.cpp
Go to the documentation of this file.
1
// $Id: GaudiMain.cpp,v 1.4 2006/09/13 15:25:15 hmd Exp $
2
//------------------------------------------------------------------------------
3
//
4
// Description: Main Program for Gaudi applications
5
//
6
//------------------------------------------------------------------------------
7
#include "
GaudiKernel/SmartIF.h
"
8
#include "
GaudiKernel/Bootstrap.h
"
9
#include "
GaudiKernel/IAppMgrUI.h
"
10
#include "
GaudiKernel/IProperty.h
"
11
#include "
GaudiKernel/Property.h
"
12
#include "
GaudiKernel/StatusCode.h
"
13
#include <iostream>
14
15
extern
"C"
GAUDI_API
int
GaudiMain
(
int
argc
,
char
**
argv
) {
16
IInterface
* iface =
Gaudi::createApplicationMgr
();
17
SmartIF<IProperty>
propMgr ( iface );
18
SmartIF<IAppMgrUI>
appMgr
( iface );
19
20
if
( !appMgr.
isValid
() || !propMgr.
isValid
() ) {
21
std::cout <<
"Fatal error while creating the ApplicationMgr "
<< std::endl;
22
return
1;
23
}
24
25
// Get the input configuration file from arguments
26
std:: string
opts
= (argc>1) ? argv[1] :
"jobOptions.txt"
;
27
28
propMgr->setProperty(
"JobOptionsPath"
, opts ).ignore();
29
30
if
( opts.substr( opts.length() - 3, 3 ) ==
".py"
) {
31
propMgr->setProperty(
"EvtSel"
,
"NONE"
).ignore();
32
propMgr->setProperty(
"JobOptionsType"
,
"NONE"
).ignore();
33
propMgr->setProperty(
"DLLs"
,
"['GaudiPython']"
).ignore();
34
propMgr->setProperty(
"Runable"
,
"PythonScriptingSvc"
).ignore();
35
}
36
37
// Run the application manager and process events
38
StatusCode
sc
= appMgr->run();
39
IntegerProperty
returnCode(
"ReturnCode"
, 0);
40
propMgr->getProperty(&returnCode).ignore();
41
// Release Application Manager
42
iface->
release
();
43
// All done - exit
44
if
(sc.
isFailure
() && returnCode.
value
() == 0) {
45
// propagate a valid error code in case of failure
46
returnCode.
setValue
(1);
47
}
48
return
returnCode.
value
();
49
}
System::argc
GAUDI_API long argc()
Number of arguments passed to the commandline (==numCmdLineArgs()); just to match argv call...
Definition:
System.cpp:526
SmartIF< IProperty >
IAppMgrUI.h
gaudirun.argv
list argv
Definition:
gaudirun.py:192
Bootstrap.h
merge_files.sc
int sc
Definition:
merge_files.py:153
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition:
StatusCode.h:72
SimpleProperty< int >
SmartIF::isValid
bool isValid() const
Allow for check if smart pointer is valid.
Definition:
SmartIF.h:51
ana.opts
dictionary opts
Definition:
ana.py:111
StatusCode
This class is used for returning status codes from appropriate routines.
Definition:
StatusCode.h:30
IInterface
Definition of the basic interface.
Definition:
IInterface.h:160
SmartIF.h
PropertyWithValue::value
const TYPE & value() const
explicit conversion
Definition:
Property.h:355
PropertyWithVerifier::setValue
virtual bool setValue(const TYPE &value)
implementation of PropertyWithValue::setValue
Definition:
Property.h:420
IProperty.h
IInterface::release
virtual unsigned long release()=0
Release Interface instance.
Property.h
IOTest.appMgr
tuple appMgr
Definition:
IOTest.py:83
GaudiMain
GAUDI_API int GaudiMain(int argc, char **argv)
Definition:
GaudiMain.cpp:15
StatusCode.h
GAUDI_API
#define GAUDI_API
Definition:
Kernel.h:108
Gaudi::createApplicationMgr
GAUDI_API IAppMgrUI * createApplicationMgr(const std::string &dllname, const std::string &factname)
GaudiKernel
src
Lib
GaudiMain.cpp
Generated on Wed Jul 9 2014 09:54:14 for The Gaudi Framework by
1.8.7