Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v36r16 (ea80daf8)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 "GaudiKernel/ObjectFactory.h"
#include "GaudiKernel/Service.h"
#include <Gaudi/Algorithm.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
 

Namespaces

 Gaudi
 Header file for std:chrono::duration-based Counters.
 

Macros

#define PyHelper(x)   py_bootstrap_##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 at line 276 of file Bootstrap.cpp.

◆ PyHelper

#define PyHelper (   x)    py_bootstrap_##x

Definition at line 239 of file Bootstrap.cpp.

Function Documentation

◆ configureApp()

bool PyHelper() configureApp ( IInterface app)

Definition at line 259 of file Bootstrap.cpp.

259  {
260  auto ui = SmartIF<IAppMgrUI>( app );
261  return ui && ui->configure().isSuccess();
262 }

◆ createApplicationMgr()

IInterface* PyHelper() createApplicationMgr ( )

Definition at line 239 of file Bootstrap.cpp.

239 { return Gaudi::createApplicationMgr(); }

◆ getProperty()

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

Definition at line 248 of file Bootstrap.cpp.

248  {
249  auto prop = SmartIF<IProperty>( p );
250  if ( !prop ) return nullptr;
251  // this is needed to guarantee that Python can access the returned char*
252  static std::string value;
253  value = prop->getProperty( name ).toString();
254  return value.c_str();
255 }

◆ getService()

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

Definition at line 240 of file Bootstrap.cpp.

240  {
241  auto svcloc = SmartIF<ISvcLocator>( app );
242  return svcloc ? svcloc->service<IInterface>( std::string_view{ name } ).get() : nullptr;
243 }

◆ py_bootstrap_app_run()

bool py_bootstrap_app_run ( IInterface i,
int  maxevt 
)

Definition at line 265 of file Bootstrap.cpp.

265  {
266  auto ep = SmartIF<IEventProcessor>( i );
267  bool stat = false;
268  // Relinquish the GIL to allow python algs in MT mode
269  Py_BEGIN_ALLOW_THREADS;
270  stat = ep && ep->executeRun( maxevt ).isSuccess();
271  Py_END_ALLOW_THREADS;
272  return stat;
273 }

◆ ROOT_VERSION_CODE()

int PyHelper() ROOT_VERSION_CODE ( )

Definition at line 263 of file Bootstrap.cpp.

263 { return ROOT_VERSION_CODE; }

◆ setOption()

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

Definition at line 256 of file Bootstrap.cpp.

256  {
257  if ( auto svcloc = SmartIF<ISvcLocator>( app ) ) { svcloc->getOptsSvc().set( key, value ); }
258 }

◆ setProperty()

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

Definition at line 244 of file Bootstrap.cpp.

244  {
245  auto prop = SmartIF<IProperty>( p );
246  return prop && prop->setProperty( name, value ).isSuccess();
247 }
Gaudi::createApplicationMgr
GAUDI_API IAppMgrUI * createApplicationMgr(const std::string &dllname, const std::string &factname)
std::string
STL class.
Read.app
app
Definition: Read.py:36
gaudirun.s
string s
Definition: gaudirun.py:348
Gaudi::Functional::details::get
auto get(const Handle &handle, const Algo &, const EventContext &) -> decltype(details::deref(handle.get()))
Definition: FunctionalDetails.h:444
TimingHistograms.name
name
Definition: TimingHistograms.py:25
std::string::c_str
T c_str(T... args)
GaudiPython.Bindings.nullptr
nullptr
Definition: Bindings.py:92
SmartIF< IStateful >
ROOT_VERSION_CODE
int PyHelper() ROOT_VERSION_CODE()
Definition: Bootstrap.cpp:263
IInterface
Definition: IInterface.h:237
ProduceConsume.key
key
Definition: ProduceConsume.py:81