The Gaudi Framework  v33r2 (a6f0ec87)
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 122 of file Bindings.py.

Constructor & Destructor Documentation

◆ __init__()

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

Reimplemented in GaudiPython.Bindings.Interface.

Definition at line 126 of file Bindings.py.

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

Member Function Documentation

◆ __call__()

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

Definition at line 131 of file Bindings.py.

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

Member Data Documentation

◆ cast

def GaudiPython.Bindings.InterfaceCast.cast = __call__
static

Definition at line 148 of file Bindings.py.

◆ type

GaudiPython.Bindings.InterfaceCast.type

Definition at line 129 of file Bindings.py.


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