| The Gaudi Framework v32r1 (f65d50dc)

Public Member Functions | Public Attributes | Static Public Attributes | List of all members
GaudiPython.Bindings.InterfaceCast Class Reference
Inheritance diagram for GaudiPython.Bindings.InterfaceCast:
[legend]
Collaboration diagram for GaudiPython.Bindings.InterfaceCast:
[legend]

## 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 97 of file Bindings.py.

## Constructor & Destructor Documentation

## ◆ __init__()

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

Reimplemented in GaudiPython.Bindings.Interface.

Definition at line 101 of file Bindings.py.

101 def __init__(self, t):
102 if type(t) is str:
103 t = getattr(gbl, t)
104 self.type = t
105
gaudirun.type
type
Definition: gaudirun.py:142

## Member Function Documentation

## ◆ __call__()

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

Definition at line 106 of file Bindings.py.

106 def __call__(self, obj):
107 if obj:
108 ip = makeNullPointer(self.type)
109 try:
110 if obj.queryInterface(self.type.interfaceID(), ip).isSuccess():
111 return ip
112 else:
113 print "ERROR: queryInterface failed for", obj, "interface:", self.type
114 except Exception as e:
115 print "ERROR: exception", e, "caught when retrieving interface", self.type, "for object", obj
116 import traceback
117 traceback.print_stack()
118 return None
119
GaudiPython.Bindings.makeNullPointer
makeNullPointer
Definition: Bindings.py:86

## Member Data Documentation

## ◆ cast

def GaudiPython.Bindings.InterfaceCast.cast = __call__
| static

Definition at line 120 of file Bindings.py.

## ◆ type

GaudiPython.Bindings.InterfaceCast.type

Definition at line 104 of file Bindings.py.

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

- GaudiPython/python/GaudiPython/Bindings.py