The Gaudi Framework  v31r0 (aeb156f0)
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 86 of file Main.py.

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

Member Function Documentation

def Gaudi.Main.BootstrapHelper.createApplicationMgr (   self)

Definition at line 134 of file Main.py.

135  ptr = self.lib.py_bootstrap_createApplicationMgr()
136  return self.AppMgr(ptr, self.lib)
137 
def createApplicationMgr(self)
Definition: Main.py:134
def Gaudi.Main.BootstrapHelper.ROOT_VERSION (   self)

Definition at line 143 of file Main.py.

143  def ROOT_VERSION(self):
144  root_version_code = self.ROOT_VERSION_CODE
145  a = root_version_code >> 16 & 0xff
146  b = root_version_code >> 8 & 0xff
147  c = root_version_code & 0xff
148  return (a, b, c)
149 
150 
def ROOT_VERSION_CODE(self)
Definition: Main.py:139
def ROOT_VERSION(self)
Definition: Main.py:143
def Gaudi.Main.BootstrapHelper.ROOT_VERSION_CODE (   self)

Definition at line 139 of file Main.py.

139  def ROOT_VERSION_CODE(self):
140  return self.lib.py_bootstrap_ROOT_VERSION_CODE()
141 
def ROOT_VERSION_CODE(self)
Definition: Main.py:139

Member Data Documentation

Gaudi.Main.BootstrapHelper.lib

Definition at line 104 of file Main.py.

Gaudi.Main.BootstrapHelper.log

Definition at line 98 of file Main.py.


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