The Gaudi Framework  v36r1 (3e2fb5a8)
Gaudi.Main.BootstrapHelper Class Reference
Inheritance diagram for Gaudi.Main.BootstrapHelper:
Collaboration diagram for Gaudi.Main.BootstrapHelper:

Classes

class  AppMgr
 
class  Property
 
class  StatusCode
 

Public Member Functions

def __init__ (self)
 
def createApplicationMgr (self)
 
def ROOT_VERSION_CODE (self)
 
def ROOT_VERSION (self)
 

Public Attributes

 log
 
 lib
 

Detailed Description

Definition at line 23 of file Main.py.

Constructor & Destructor Documentation

◆ __init__()

def Gaudi.Main.BootstrapHelper.__init__ (   self)

Definition at line 108 of file Main.py.

108  def __init__(self):
109  from ctypes import (PyDLL, util, c_void_p, c_bool, c_char_p, c_int,
110  RTLD_GLOBAL)
111 
112  # Helper class to avoid void* to int conversion
113  # (see http://stackoverflow.com/questions/17840144)
114 
115  class IInterface_p(c_void_p):
116  def __repr__(self):
117  return "IInterface_p(0x%x)" % (0 if self.value is None else
118  self.value)
119 
120  self.log = logging.getLogger('BootstrapHelper')
121  libname = util.find_library('GaudiKernel') or 'libGaudiKernel.so'
122  self.log.debug('loading GaudiKernel (%s)', libname)
123 
124  # FIXME: note that we need PyDLL instead of CDLL if the calls to
125  # Python functions are not protected with the GIL.
126  self.lib = gkl = PyDLL(libname, mode=RTLD_GLOBAL)
127 
128  functions = [
129  ('createApplicationMgr', IInterface_p, []),
130  ('getService', IInterface_p, [IInterface_p, c_char_p]),
131  ('setProperty', c_bool, [IInterface_p, c_char_p, c_char_p]),
132  ('getProperty', c_char_p, [IInterface_p, c_char_p]),
133  ('setOption', None, [IInterface_p, c_char_p, c_char_p]),
134  ('ROOT_VERSION_CODE', c_int, []),
135  ]
136 
137  for name, restype, argtypes in functions:
138  f = getattr(gkl, 'py_bootstrap_%s' % name)
139  f.restype, f.argtypes = restype, argtypes
140  # create a delegate method if not already present
141  # (we do not want to use hasattr because it calls "properties")
142  if name not in self.__class__.__dict__:
143  setattr(self, name, f)
144 
145  for name in ('configure', 'initialize', 'start', 'stop', 'finalize',
146  'terminate'):
147  f = getattr(gkl, 'py_bootstrap_fsm_%s' % name)
148  f.restype, f.argtypes = c_bool, [IInterface_p]
149  gkl.py_bootstrap_app_run.restype = c_bool
150  gkl.py_bootstrap_app_run.argtypes = [IInterface_p, c_int]
151 
152  gkl.py_helper_printAlgsSequences.restype = None
153  gkl.py_helper_printAlgsSequences.argtypes = [IInterface_p]
154 

Member Function Documentation

◆ createApplicationMgr()

def Gaudi.Main.BootstrapHelper.createApplicationMgr (   self)

Definition at line 155 of file Main.py.

155  def createApplicationMgr(self):
156  ptr = self.lib.py_bootstrap_createApplicationMgr()
157  return self.AppMgr(ptr, self.lib)
158 

◆ ROOT_VERSION()

def Gaudi.Main.BootstrapHelper.ROOT_VERSION (   self)

Definition at line 164 of file Main.py.

164  def ROOT_VERSION(self):
165  root_version_code = self.ROOT_VERSION_CODE
166  a = root_version_code >> 16 & 0xff
167  b = root_version_code >> 8 & 0xff
168  c = root_version_code & 0xff
169  return (a, b, c)
170 
171 

◆ ROOT_VERSION_CODE()

def Gaudi.Main.BootstrapHelper.ROOT_VERSION_CODE (   self)

Definition at line 160 of file Main.py.

160  def ROOT_VERSION_CODE(self):
161  return self.lib.py_bootstrap_ROOT_VERSION_CODE()
162 

Member Data Documentation

◆ lib

Gaudi.Main.BootstrapHelper.lib

Definition at line 126 of file Main.py.

◆ log

Gaudi.Main.BootstrapHelper.log

Definition at line 120 of file Main.py.


The documentation for this class was generated from the following file:
createApplicationMgr
IInterface *PyHelper() createApplicationMgr()
Definition: Bootstrap.cpp:237
GaudiPython.HistoUtils.__repr__
__repr__
Definition: HistoUtils.py:519
ROOT_VERSION_CODE
int PyHelper() ROOT_VERSION_CODE()
Definition: Bootstrap.cpp:261