The Gaudi Framework  v32r2 (46d42edc)
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 13 of file Main.py.

Constructor & Destructor Documentation

◆ __init__()

def Gaudi.Main.BootstrapHelper.__init__ (   self)

Definition at line 94 of file Main.py.

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

Member Function Documentation

◆ createApplicationMgr()

def Gaudi.Main.BootstrapHelper.createApplicationMgr (   self)

Definition at line 142 of file Main.py.

142  def createApplicationMgr(self):
143  ptr = self.lib.py_bootstrap_createApplicationMgr()
144  return self.AppMgr(ptr, self.lib)
145 
IInterface *PyHelper() createApplicationMgr()
Definition: Bootstrap.cpp:228

◆ ROOT_VERSION()

def Gaudi.Main.BootstrapHelper.ROOT_VERSION (   self)

Definition at line 151 of file Main.py.

151  def ROOT_VERSION(self):
152  root_version_code = self.ROOT_VERSION_CODE
153  a = root_version_code >> 16 & 0xff
154  b = root_version_code >> 8 & 0xff
155  c = root_version_code & 0xff
156  return (a, b, c)
157 
158 

◆ ROOT_VERSION_CODE()

def Gaudi.Main.BootstrapHelper.ROOT_VERSION_CODE (   self)

Definition at line 147 of file Main.py.

147  def ROOT_VERSION_CODE(self):
148  return self.lib.py_bootstrap_ROOT_VERSION_CODE()
149 
int PyHelper() ROOT_VERSION_CODE()
Definition: Bootstrap.cpp:249

Member Data Documentation

◆ lib

Gaudi.Main.BootstrapHelper.lib

Definition at line 112 of file Main.py.

◆ log

Gaudi.Main.BootstrapHelper.log

Definition at line 106 of file Main.py.


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