The Gaudi Framework  v33r0 (d5ea422b)
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 112 of file Bindings.py.

Constructor & Destructor Documentation

◆ __init__()

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

Reimplemented in GaudiPython.Bindings.Interface.

Definition at line 116 of file Bindings.py.

116  def __init__(self, t):
117  if type(t) is str:
118  t = getattr(gbl, t)
119  self.type = t
120 

Member Function Documentation

◆ __call__()

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

Definition at line 121 of file Bindings.py.

121  def __call__(self, obj):
122  if obj:
123  ip = makeNullPointer(self.type)
124  try:
125  if obj.queryInterface(self.type.interfaceID(), ip).isSuccess():
126  return ip
127  else:
128  print("ERROR: queryInterface failed for", obj,
129  "interface:", self.type)
130  except Exception as e:
131  print("ERROR: exception", e,
132  "caught when retrieving interface", self.type,
133  "for object", obj)
134  import traceback
135  traceback.print_stack()
136  return None
137 

Member Data Documentation

◆ cast

def GaudiPython.Bindings.InterfaceCast.cast = __call__
static

Definition at line 138 of file Bindings.py.

◆ type

GaudiPython.Bindings.InterfaceCast.type

Definition at line 119 of file Bindings.py.


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