The Gaudi Framework  v36r13 (995e4364)
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 112 of file Main.py.

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

Member Function Documentation

◆ createApplicationMgr()

def Gaudi.Main.BootstrapHelper.createApplicationMgr (   self)

Definition at line 163 of file Main.py.

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

◆ ROOT_VERSION()

def Gaudi.Main.BootstrapHelper.ROOT_VERSION (   self)

Definition at line 172 of file Main.py.

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

◆ ROOT_VERSION_CODE()

def Gaudi.Main.BootstrapHelper.ROOT_VERSION_CODE (   self)

Definition at line 168 of file Main.py.

168  def ROOT_VERSION_CODE(self):
169  return self.lib.py_bootstrap_ROOT_VERSION_CODE()
170 

Member Data Documentation

◆ lib

Gaudi.Main.BootstrapHelper.lib

Definition at line 128 of file Main.py.

◆ log

Gaudi.Main.BootstrapHelper.log

Definition at line 122 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