The Gaudi Framework  master (bdbe7744)
Loading...
Searching...
No Matches
GaudiPython.Bindings.InterfaceCast Class Reference
Inheritance diagram for GaudiPython.Bindings.InterfaceCast:

Public Member Functions

 __init__ (self, t)
 __call__ (self, obj)

Public Attributes

 type = t

Static Public Attributes

 cast = __call__

Detailed Description

Helper class to obtain the adequate interface from a component
by using the Gaudi queryInterface() mechanism

Definition at line 139 of file Bindings.py.

Constructor & Destructor Documentation

◆ __init__()

GaudiPython.Bindings.InterfaceCast.__init__ ( self,
t )

Definition at line 143 of file Bindings.py.

143 def __init__(self, t):
144 if isinstance(t, str):
145 t = getattr(gbl, t)
146 self.type = t
147

Member Function Documentation

◆ __call__()

GaudiPython.Bindings.InterfaceCast.__call__ ( self,
obj )

Definition at line 148 of file Bindings.py.

148 def __call__(self, obj):
149 if obj:
150 ip = makeNullPointer(self.type)
151 try:
152 if obj.queryInterface(self.type.interfaceID(), ip).isSuccess():
153 return ip
154 else:
155 print(
156 "ERROR: queryInterface failed for", obj, "interface:", self.type
157 )
158 except Exception as e:
159 print(
160 "ERROR: exception",
161 e,
162 "caught when retrieving interface",
163 self.type,
164 "for object",
165 obj,
166 )
167 import traceback
168
169 traceback.print_stack()
170 return cppyy.nullptr
171

Member Data Documentation

◆ cast

GaudiPython.Bindings.InterfaceCast.cast = __call__
static

Reimplemented in GaudiPython.Bindings.Interface.

Definition at line 172 of file Bindings.py.

◆ type

GaudiPython.Bindings.InterfaceCast.type = t

Definition at line 146 of file Bindings.py.


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