The Gaudi Framework  v33r0 (d5ea422b)
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 104 of file Main.py.

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

Member Function Documentation

◆ createApplicationMgr()

def Gaudi.Main.BootstrapHelper.createApplicationMgr (   self)

Definition at line 152 of file Main.py.

152  def createApplicationMgr(self):
153  ptr = self.lib.py_bootstrap_createApplicationMgr()
154  return self.AppMgr(ptr, self.lib)
155 
IInterface *PyHelper() createApplicationMgr()
Definition: Bootstrap.cpp:238

◆ ROOT_VERSION()

def Gaudi.Main.BootstrapHelper.ROOT_VERSION (   self)

Definition at line 161 of file Main.py.

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

◆ ROOT_VERSION_CODE()

def Gaudi.Main.BootstrapHelper.ROOT_VERSION_CODE (   self)

Definition at line 157 of file Main.py.

157  def ROOT_VERSION_CODE(self):
158  return self.lib.py_bootstrap_ROOT_VERSION_CODE()
159 
int PyHelper() ROOT_VERSION_CODE()
Definition: Bootstrap.cpp:259

Member Data Documentation

◆ lib

Gaudi.Main.BootstrapHelper.lib

Definition at line 122 of file Main.py.

◆ log

Gaudi.Main.BootstrapHelper.log

Definition at line 116 of file Main.py.


The documentation for this class was generated from the following file: