The Gaudi Framework  master (b9786168)
Loading...
Searching...
No Matches
Bootstrap.cpp File Reference
#include <iostream>
#include <GaudiKernel/Bootstrap.h>
#include <GaudiKernel/System.h>
#include <GaudiKernel/IAlgorithm.h>
#include <GaudiKernel/IAppMgrUI.h>
#include <GaudiKernel/IClassManager.h>
#include <GaudiKernel/IInterface.h>
#include <GaudiKernel/IService.h>
#include <GaudiKernel/ISvcLocator.h>
#include <Gaudi/Algorithm.h>
#include <GaudiKernel/ObjectFactory.h>
#include <GaudiKernel/Service.h>
#include <GaudiKernel/IEventProcessor.h>
#include <RVersion.h>
#include <Python.h>
Include dependency graph for Bootstrap.cpp:

Go to the source code of this file.

Classes

class  Gaudi::BootSvcLocator
 A dual-stage boostrap mechanism is used to ensure an orderly startup of the ApplicationMgr. More...
 
class  BootSvcLocator
 A dual-stage boostrap mechanism is used to ensure an orderly startup of the ApplicationMgr. More...
 

Namespaces

namespace  Gaudi
 This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from python with a format liks : ( nbins, min, max, title ) where title can be ommited.
 

Macros

#define PyHelper(x)
 
#define PyFSMHelper(s)
 

Functions

IInterface *PyHelper createApplicationMgr ()
 
IInterface *PyHelper getService (IInterface *app, char *name)
 
bool PyHelper setProperty (IInterface *p, char *name, char *value)
 
const char *PyHelper getProperty (IInterface *p, char *name)
 
void PyHelper setOption (IInterface *app, char *key, char *value)
 
bool PyHelper configureApp (IInterface *app)
 
int PyHelper ROOT_VERSION_CODE ()
 
bool py_bootstrap_app_run (IInterface *i, int maxevt)
 

Macro Definition Documentation

◆ PyFSMHelper

#define PyFSMHelper ( s)
Value:
bool py_bootstrap_fsm_##s( IInterface* i ) { \
auto fsm = SmartIF<IStateful>( i ); \
return fsm && fsm->s().isSuccess(); \
}
Definition of the basic interface.
Definition IInterface.h:225
Small smart pointer class with automatic reference counting for IInterface.
Definition SmartIF.h:28

Definition at line 242 of file Bootstrap.cpp.

242#define PyFSMHelper( s ) \
243 bool py_bootstrap_fsm_##s( IInterface* i ) { \
244 auto fsm = SmartIF<IStateful>( i ); \
245 return fsm && fsm->s().isSuccess(); \
246 }

◆ PyHelper

#define PyHelper ( x)
Value:
py_bootstrap_##x

Definition at line 205 of file Bootstrap.cpp.

Function Documentation

◆ configureApp()

bool PyHelper configureApp ( IInterface * app)

Definition at line 226 of file Bootstrap.cpp.

226 {
227 auto ui = SmartIF<IAppMgrUI>( app );
228 return ui && ui->configure().isSuccess();
229}

◆ createApplicationMgr()

IInterface *PyHelper createApplicationMgr ( )

Definition at line 206 of file Bootstrap.cpp.

206{ return Gaudi::createApplicationMgr(); }
GAUDI_API IAppMgrUI * createApplicationMgr()

◆ getProperty()

const char *PyHelper getProperty ( IInterface * p,
char * name )

Definition at line 215 of file Bootstrap.cpp.

215 {
216 auto prop = SmartIF<IProperty>( p );
217 if ( !prop ) return nullptr;
218 // this is needed to guarantee that Python can access the returned char*
219 static std::string value;
220 value = prop->getProperty( name ).toString();
221 return value.c_str();
222}

◆ getService()

IInterface *PyHelper getService ( IInterface * app,
char * name )

Definition at line 207 of file Bootstrap.cpp.

207 {
208 auto svcloc = SmartIF<ISvcLocator>( app );
209 return svcloc ? svcloc->service<IInterface>( std::string_view{ name } ).get() : nullptr;
210}
get
decorate the vector of properties
Definition decorators.py:94

◆ py_bootstrap_app_run()

bool py_bootstrap_app_run ( IInterface * i,
int maxevt )

Definition at line 232 of file Bootstrap.cpp.

232 {
233 auto ep = SmartIF<IEventProcessor>( i );
234 bool stat = false;
235 // Relinquish the GIL to allow python algs in MT mode
236 Py_BEGIN_ALLOW_THREADS;
237 stat = ep && ep->executeRun( maxevt ).isSuccess();
238 Py_END_ALLOW_THREADS;
239 return stat;
240}

◆ ROOT_VERSION_CODE()

int PyHelper ROOT_VERSION_CODE ( )

Definition at line 230 of file Bootstrap.cpp.

230{ return ROOT_VERSION_CODE; }
int PyHelper ROOT_VERSION_CODE()

◆ setOption()

void PyHelper setOption ( IInterface * app,
char * key,
char * value )

Definition at line 223 of file Bootstrap.cpp.

223 {
224 if ( auto svcloc = SmartIF<ISvcLocator>( app ) ) { svcloc->getOptsSvc().set( key, value ); }
225}

◆ setProperty()

bool PyHelper setProperty ( IInterface * p,
char * name,
char * value )

Definition at line 211 of file Bootstrap.cpp.

211 {
212 auto prop = SmartIF<IProperty>( p );
213 return prop && prop->setProperty( name, value ).isSuccess();
214}