The Gaudi Framework  v37r1 (a7f61348)
GaudiPython.Bindings.InterfaceCast Class Reference
Inheritance diagram for GaudiPython.Bindings.InterfaceCast:
Collaboration diagram for GaudiPython.Bindings.InterfaceCast:

Public Member Functions

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

Public Attributes

 type
 

Static Public Attributes

 cast
 

Detailed Description

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

Definition at line 141 of file Bindings.py.

Constructor & Destructor Documentation

◆ __init__()

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

Reimplemented in GaudiPython.Bindings.Interface.

Definition at line 145 of file Bindings.py.

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

Member Function Documentation

◆ __call__()

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

Definition at line 150 of file Bindings.py.

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

Member Data Documentation

◆ cast

GaudiPython.Bindings.InterfaceCast.cast
static

Definition at line 174 of file Bindings.py.

◆ type

GaudiPython.Bindings.InterfaceCast.type

Definition at line 148 of file Bindings.py.


The documentation for this class was generated from the following file:
GaudiPython.Bindings.makeNullPointer
makeNullPointer
Definition: Bindings.py:130
gaudirun.type
type
Definition: gaudirun.py:162