| The Gaudi Framework v32r1 (f65d50dc)

Classes | Public Member Functions | Public Attributes | List of all members
Gaudi.Main.BootstrapHelper Class Reference
Inheritance diagram for Gaudi.Main.BootstrapHelper:
[legend]
Collaboration diagram for Gaudi.Main.BootstrapHelper:
[legend]

## 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

## ◆ __init__()

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
GaudiPython.HistoUtils.__repr__
__repr__
Definition: HistoUtils.py:508

## Member Function Documentation

## ◆ createApplicationMgr()

def Gaudi.Main.BootstrapHelper.createApplicationMgr | ( |  | self | ) |

Definition at line 134 of file Main.py.

134 def createApplicationMgr(self):
135 ptr = self.lib.py_bootstrap_createApplicationMgr()
136 return self.AppMgr(ptr, self.lib)
137
createApplicationMgr
IInterface *PyHelper() createApplicationMgr()
Definition: Bootstrap.cpp:228

## ◆ ROOT_VERSION()

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

## ◆ ROOT_VERSION_CODE()

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
ROOT_VERSION_CODE
int PyHelper() ROOT_VERSION_CODE()
Definition: Bootstrap.cpp:249

## Member Data Documentation

## ◆ lib

Gaudi.Main.BootstrapHelper.lib

Definition at line 104 of file Main.py.

## ◆ log

Gaudi.Main.BootstrapHelper.log

Definition at line 98 of file Main.py.

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

- Gaudi/python/Gaudi/Main.py