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

Member Function Documentation

def Gaudi.Main.BootstrapHelper.createApplicationMgr (   self)

Definition at line 121 of file Main.py.

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

Definition at line 130 of file Main.py.

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

Definition at line 126 of file Main.py.

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

Member Data Documentation

Gaudi.Main.BootstrapHelper.lib

Definition at line 91 of file Main.py.

Gaudi.Main.BootstrapHelper.log

Definition at line 85 of file Main.py.


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