The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
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

 __init__ (self)
 
 createApplicationMgr (self)
 
 ROOT_VERSION_CODE (self)
 
 ROOT_VERSION (self)
 

Public Attributes

 value
 
 log = logging.getLogger("BootstrapHelper")
 
 lib = PyDLL(libname, mode=RTLD_GLOBAL)
 

Detailed Description

Definition at line 21 of file Main.py.

Constructor & Destructor Documentation

◆ __init__()

Gaudi.Main.BootstrapHelper.__init__ ( self)

Definition at line 110 of file Main.py.

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

Member Function Documentation

◆ createApplicationMgr()

Gaudi.Main.BootstrapHelper.createApplicationMgr ( self)

Definition at line 161 of file Main.py.

161 def createApplicationMgr(self):
162 ptr = self.lib.py_bootstrap_createApplicationMgr()
163 return self.AppMgr(ptr, self.lib)
164
IInterface *PyHelper createApplicationMgr()

◆ ROOT_VERSION()

Gaudi.Main.BootstrapHelper.ROOT_VERSION ( self)

Definition at line 170 of file Main.py.

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

◆ ROOT_VERSION_CODE()

Gaudi.Main.BootstrapHelper.ROOT_VERSION_CODE ( self)

Definition at line 166 of file Main.py.

166 def ROOT_VERSION_CODE(self):
167 return self.lib.py_bootstrap_ROOT_VERSION_CODE()
168
int PyHelper ROOT_VERSION_CODE()

Member Data Documentation

◆ lib

Gaudi.Main.BootstrapHelper.lib = PyDLL(libname, mode=RTLD_GLOBAL)

Definition at line 126 of file Main.py.

◆ log

Gaudi.Main.BootstrapHelper.log = logging.getLogger("BootstrapHelper")

Definition at line 120 of file Main.py.

◆ value

Gaudi.Main.BootstrapHelper.value

Definition at line 118 of file Main.py.


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