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)
 
def __init__ (self, t)
 
def __call__ (self, obj)
 

Public Attributes

 type
 

Static Public Attributes

 cast = __call__
 

Detailed Description

Helper class to obtain the adequate interface from a component
    by using the Gaudi queryInterface() mechanism 

Definition at line 77 of file Bindings.py.

Constructor & Destructor Documentation

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

Definition at line 80 of file Bindings.py.

80  def __init__(self, t ) :
81  if type(t) is str:
82  t = getattr(gbl, t)
83  self.type = t
def GaudiPython.Bindings.InterfaceCast.__init__ (   self,
  t 
)

Definition at line 80 of file Bindings.py.

80  def __init__(self, t ) :
81  if type(t) is str:
82  t = getattr(gbl, t)
83  self.type = t

Member Function Documentation

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

Definition at line 84 of file Bindings.py.

84  def __call__(self, obj) :
85  if obj :
86  ip = makeNullPointer(self.type)
87  try:
88  if obj.queryInterface(self.type.interfaceID(), ip).isSuccess() :
89  return ip
90  else :
91  print "ERROR: queryInterface failed for", obj, "interface:", self.type
92  except Exception, e:
93  print "ERROR: exception", e, "caught when retrieving interface", self.type, "for object", obj
94  import traceback
95  traceback.print_stack()
96  return None
def GaudiPython.Bindings.InterfaceCast.__call__ (   self,
  obj 
)

Definition at line 84 of file Bindings.py.

84  def __call__(self, obj) :
85  if obj :
86  ip = makeNullPointer(self.type)
87  try:
88  if obj.queryInterface(self.type.interfaceID(), ip).isSuccess() :
89  return ip
90  else :
91  print "ERROR: queryInterface failed for", obj, "interface:", self.type
92  except Exception, e:
93  print "ERROR: exception", e, "caught when retrieving interface", self.type, "for object", obj
94  import traceback
95  traceback.print_stack()
96  return None

Member Data Documentation

GaudiPython.Bindings.InterfaceCast.cast = __call__
static

Definition at line 97 of file Bindings.py.

GaudiPython.Bindings.InterfaceCast.type

Definition at line 83 of file Bindings.py.


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