The Gaudi Framework  master (b9786168)
Loading...
Searching...
No Matches
GaudiPython.Bindings.InterfaceCast Class Reference
Inheritance diagram for GaudiPython.Bindings.InterfaceCast:
Collaboration 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 140 of file Bindings.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 144 of file Bindings.py.

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

Member Function Documentation

◆ __call__()

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

Definition at line 149 of file Bindings.py.

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

Member Data Documentation

◆ cast

GaudiPython.Bindings.InterfaceCast.cast = __call__
static

Reimplemented in GaudiPython.Bindings.Interface.

Definition at line 173 of file Bindings.py.

◆ type

GaudiPython.Bindings.InterfaceCast.type = t

Definition at line 147 of file Bindings.py.


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