The Gaudi Framework  v36r9p1 (5c15b2bb)
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

def cast = __call__
 

Detailed Description

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

Definition at line 146 of file Bindings.py.

Constructor & Destructor Documentation

◆ __init__()

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

Reimplemented in GaudiPython.Bindings.Interface.

Definition at line 150 of file Bindings.py.

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

Member Function Documentation

◆ __call__()

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

Definition at line 155 of file Bindings.py.

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

Member Data Documentation

◆ cast

def GaudiPython.Bindings.InterfaceCast.cast = __call__
static

Definition at line 179 of file Bindings.py.

◆ type

GaudiPython.Bindings.InterfaceCast.type

Definition at line 153 of file Bindings.py.


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