The Gaudi Framework  v29r0 (ff2e7097)
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 10 of file Main.py.

Constructor & Destructor Documentation

def Gaudi.Main.BootstrapHelper.__init__ (   self)

Definition at line 75 of file Main.py.

75  def __init__(self):
76  from ctypes import PyDLL, util, c_void_p, c_bool, c_char_p, c_int
77  # Helper class to avoid void* to int conversion
78  # (see http://stackoverflow.com/questions/17840144)
79 
80  class IInterface_p(c_void_p):
81  def __repr__(self):
82  return "IInterface_p(0x%x)" % (0 if self.value is None
83  else self.value)
84  self.log = logging.getLogger('BootstrapHelper')
85  libname = util.find_library('GaudiKernel') or 'libGaudiKernel.so'
86  self.log.debug('loading GaudiKernel (%s)', libname)
87 
88  # FIXME: note that we need PyDLL instead of CDLL if the calls to
89  # Python functions are not protected with the GIL.
90  self.lib = gkl = PyDLL(libname)
91 
92  functions = [('createApplicationMgr', IInterface_p, []),
93  ('getService', IInterface_p, [IInterface_p, c_char_p]),
94  ('setProperty', c_bool, [
95  IInterface_p, c_char_p, c_char_p]),
96  ('getProperty', c_char_p, [IInterface_p, c_char_p]),
97  ('addPropertyToCatalogue', c_bool, [
98  IInterface_p, c_char_p, c_char_p, c_char_p]),
99  ('ROOT_VERSION_CODE', c_int, []),
100  ]
101 
102  for name, restype, argtypes in functions:
103  f = getattr(gkl, 'py_bootstrap_%s' % name)
104  f.restype, f.argtypes = restype, argtypes
105  # create a delegate method if not already present
106  # (we do not want to use hasattr because it calls "properties")
107  if name not in self.__class__.__dict__:
108  setattr(self, name, f)
109 
110  for name in ('configure', 'initialize', 'start',
111  'stop', 'finalize', 'terminate'):
112  f = getattr(gkl, 'py_bootstrap_fsm_%s' % name)
113  f.restype, f.argtypes = c_bool, [IInterface_p]
114  gkl.py_bootstrap_app_run.restype = c_bool
115  gkl.py_bootstrap_app_run.argtypes = [IInterface_p, c_int]
116 
117  gkl.py_helper_printAlgsSequences.restype = None
118  gkl.py_helper_printAlgsSequences.argtypes = [IInterface_p]
119 
def __init__(self)
Definition: Main.py:75

Member Function Documentation

def Gaudi.Main.BootstrapHelper.createApplicationMgr (   self)

Definition at line 120 of file Main.py.

121  ptr = self.lib.py_bootstrap_createApplicationMgr()
122  return self.AppMgr(ptr, self.lib)
123 
def createApplicationMgr(self)
Definition: Main.py:120
def Gaudi.Main.BootstrapHelper.ROOT_VERSION (   self)

Definition at line 129 of file Main.py.

129  def ROOT_VERSION(self):
130  root_version_code = self.ROOT_VERSION_CODE
131  a = root_version_code >> 16 & 0xff
132  b = root_version_code >> 8 & 0xff
133  c = root_version_code & 0xff
134  return (a, b, c)
135 
136 
def ROOT_VERSION_CODE(self)
Definition: Main.py:125
def ROOT_VERSION(self)
Definition: Main.py:129
def Gaudi.Main.BootstrapHelper.ROOT_VERSION_CODE (   self)

Definition at line 125 of file Main.py.

125  def ROOT_VERSION_CODE(self):
126  return self.lib.py_bootstrap_ROOT_VERSION_CODE()
127 
def ROOT_VERSION_CODE(self)
Definition: Main.py:125

Member Data Documentation

Gaudi.Main.BootstrapHelper.lib

Definition at line 90 of file Main.py.

Gaudi.Main.BootstrapHelper.log

Definition at line 84 of file Main.py.


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