The Gaudi Framework  v36r1 (3e2fb5a8)
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 124 of file Bindings.py.

Constructor & Destructor Documentation

◆ __init__()

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

Reimplemented in GaudiPython.Bindings.Interface.

Definition at line 128 of file Bindings.py.

128  def __init__(self, t):
129  if type(t) is str:
130  t = getattr(gbl, t)
131  self.type = t
132 

Member Function Documentation

◆ __call__()

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

Definition at line 133 of file Bindings.py.

133  def __call__(self, obj):
134  if obj:
135  ip = makeNullPointer(self.type)
136  try:
137  if obj.queryInterface(self.type.interfaceID(), ip).isSuccess():
138  return ip
139  else:
140  print("ERROR: queryInterface failed for", obj,
141  "interface:", self.type)
142  except Exception as e:
143  print("ERROR: exception", e,
144  "caught when retrieving interface", self.type,
145  "for object", obj)
146  import traceback
147  traceback.print_stack()
148  return cppyy.nullptr
149 

Member Data Documentation

◆ cast

def GaudiPython.Bindings.InterfaceCast.cast = __call__
static

Definition at line 150 of file Bindings.py.

◆ type

GaudiPython.Bindings.InterfaceCast.type

Definition at line 131 of file Bindings.py.


The documentation for this class was generated from the following file:
GaudiPython.Bindings.makeNullPointer
makeNullPointer
Definition: Bindings.py:113
gaudirun.type
type
Definition: gaudirun.py:154
Counter.__call__
__call__
Definition: Counter.py:40