The Gaudi Framework  v36r16 (ea80daf8)
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 145 of file Bindings.py.

Constructor & Destructor Documentation

◆ __init__()

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

Reimplemented in GaudiPython.Bindings.Interface.

Definition at line 149 of file Bindings.py.

149  def __init__(self, t):
150  if type(t) is str:
151  t = getattr(gbl, t)
152  self.type = t
153 

Member Function Documentation

◆ __call__()

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

Definition at line 154 of file Bindings.py.

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

Member Data Documentation

◆ cast

GaudiPython.Bindings.InterfaceCast.cast
static

Definition at line 178 of file Bindings.py.

◆ type

GaudiPython.Bindings.InterfaceCast.type

Definition at line 152 of file Bindings.py.


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