The Gaudi Framework
v26r3
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
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
}
SmartIF< IProperty >
IAppMgrUI::run
virtual StatusCode run()=0
Run the complete job (from initialize to terminate)
IProperty::getProperty
virtual StatusCode getProperty(Property *p) const =0
Get the property by property.
GAUDI_API
#define GAUDI_API
Definition:
Kernel.h:108
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:85
System::argc
GAUDI_API long argc()
Number of arguments passed to the commandline (==numCmdLineArgs()); just to match argv call...
Definition:
System.cpp:536
gaudirun.argv
list argv
Definition:
gaudirun.py:226
SimpleProperty< int >
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
IProperty::setProperty
virtual StatusCode setProperty(const Property &p)=0
Set the property by property.
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
IInterface::release
virtual unsigned long release()=0
Release Interface instance.
SmartIF::isValid
bool isValid() const
Allow for check if smart pointer is valid.
Definition:
SmartIF.h:51
IOTest.appMgr
tuple appMgr
Definition:
IOTest.py:83
GaudiMain
GAUDI_API int GaudiMain(int argc, char **argv)
Definition:
GaudiMain.cpp:15
StatusCode::ignore
void ignore() const
Definition:
StatusCode.h:107
Gaudi::createApplicationMgr
GAUDI_API IAppMgrUI * createApplicationMgr(const std::string &dllname, const std::string &factname)
GaudiKernel
src
Lib
GaudiMain.cpp
Generated on Tue Jul 21 2015 12:23:34 for The Gaudi Framework by
1.8.9.1