The Gaudi Framework  v36r11 (bdb84f5f)
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 25 of file Main.py.

Constructor & Destructor Documentation

◆ __init__()

def Gaudi.Main.BootstrapHelper.__init__ (   self)

Definition at line 114 of file Main.py.

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

Member Function Documentation

◆ createApplicationMgr()

def Gaudi.Main.BootstrapHelper.createApplicationMgr (   self)

Definition at line 165 of file Main.py.

165  def createApplicationMgr(self):
166  ptr = self.lib.py_bootstrap_createApplicationMgr()
167  return self.AppMgr(ptr, self.lib)
168 

◆ ROOT_VERSION()

def Gaudi.Main.BootstrapHelper.ROOT_VERSION (   self)

Definition at line 174 of file Main.py.

174  def ROOT_VERSION(self):
175  root_version_code = self.ROOT_VERSION_CODE
176  a = root_version_code >> 16 & 0xFF
177  b = root_version_code >> 8 & 0xFF
178  c = root_version_code & 0xFF
179  return (a, b, c)
180 
181 

◆ ROOT_VERSION_CODE()

def Gaudi.Main.BootstrapHelper.ROOT_VERSION_CODE (   self)

Definition at line 170 of file Main.py.

170  def ROOT_VERSION_CODE(self):
171  return self.lib.py_bootstrap_ROOT_VERSION_CODE()
172 

Member Data Documentation

◆ lib

Gaudi.Main.BootstrapHelper.lib

Definition at line 130 of file Main.py.

◆ log

Gaudi.Main.BootstrapHelper.log

Definition at line 124 of file Main.py.


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