The Gaudi Framework  v32r2 (46d42edc)
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 102 of file Bindings.py.

Constructor & Destructor Documentation

◆ __init__()

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

Reimplemented in GaudiPython.Bindings.Interface.

Definition at line 106 of file Bindings.py.

106  def __init__(self, t):
107  if type(t) is str:
108  t = getattr(gbl, t)
109  self.type = t
110 

Member Function Documentation

◆ __call__()

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

Definition at line 111 of file Bindings.py.

111  def __call__(self, obj):
112  if obj:
113  ip = makeNullPointer(self.type)
114  try:
115  if obj.queryInterface(self.type.interfaceID(), ip).isSuccess():
116  return ip
117  else:
118  print("ERROR: queryInterface failed for", obj,
119  "interface:", self.type)
120  except Exception as e:
121  print("ERROR: exception", e,
122  "caught when retrieving interface", self.type,
123  "for object", obj)
124  import traceback
125  traceback.print_stack()
126  return None
127 

Member Data Documentation

◆ cast

def GaudiPython.Bindings.InterfaceCast.cast = __call__
static

Definition at line 128 of file Bindings.py.

◆ type

GaudiPython.Bindings.InterfaceCast.type

Definition at line 109 of file Bindings.py.


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