GaudiPython.GaudiAlgs.TupleDecColumnDispatcher Class Reference
Inheritance diagram for GaudiPython.GaudiAlgs.TupleDecColumnDispatcher:
Collaboration diagram for GaudiPython.GaudiAlgs.TupleDecColumnDispatcher:

Public Member Functions

def __init__ (self, func)
 
def __call__ (self, a)
 
def __init__ (self, func)
 
def __call__ (self, a)
 

Public Attributes

 func
 
 mapping
 

Private Attributes

 __doc__
 

Detailed Description

Helper decorator class to workaround ROOT-6697

Definition at line 1044 of file GaudiAlgs.py.

Constructor & Destructor Documentation

def GaudiPython.GaudiAlgs.TupleDecColumnDispatcher.__init__ (   self,
  func 
)

Definition at line 1046 of file GaudiAlgs.py.

1046  def __init__(self, func):
1047  self.func = func
1048  self.__doc__ = func.__doc__
1049 
1050  mapping = {int: 'int', bool: 'bool', float: 'double'}
1051  for k in mapping:
1052  signature = 'const Tuples::Tuple& tuple, const string& name, const %s value'%(mapping[k])
1053  mapping[k] = func.disp(signature)
1054  self.mapping = mapping
1055 
def GaudiPython.GaudiAlgs.TupleDecColumnDispatcher.__init__ (   self,
  func 
)

Definition at line 1046 of file GaudiAlgs.py.

1046  def __init__(self, func):
1047  self.func = func
1048  self.__doc__ = func.__doc__
1049 
1050  mapping = {int: 'int', bool: 'bool', float: 'double'}
1051  for k in mapping:
1052  signature = 'const Tuples::Tuple& tuple, const string& name, const %s value'%(mapping[k])
1053  mapping[k] = func.disp(signature)
1054  self.mapping = mapping
1055 

Member Function Documentation

def GaudiPython.GaudiAlgs.TupleDecColumnDispatcher.__call__ (   self,
  a 
)
Explicitly call the explicit signature for the case with 3 arguments and
the last one is 'int', 'bool' or 'float', for the other cases fall back
on the default dispatcher.

Definition at line 1056 of file GaudiAlgs.py.

1056  def __call__(self, *a):
1057  '''
1058  Explicitly call the explicit signature for the case with 3 arguments and
1059  the last one is 'int', 'bool' or 'float', for the other cases fall back
1060  on the default dispatcher.
1061  '''
1062  if len(a) == 3:
1063  t = type(a[-1])
1064  try:
1065  return self.mapping[t](*a)
1066  except KeyError:
1067  pass
1068  return self.func(*a)
1069 
string type
Definition: gaudirun.py:151
def GaudiPython.GaudiAlgs.TupleDecColumnDispatcher.__call__ (   self,
  a 
)
Explicitly call the explicit signature for the case with 3 arguments and
the last one is 'int', 'bool' or 'float', for the other cases fall back
on the default dispatcher.

Definition at line 1056 of file GaudiAlgs.py.

1056  def __call__(self, *a):
1057  '''
1058  Explicitly call the explicit signature for the case with 3 arguments and
1059  the last one is 'int', 'bool' or 'float', for the other cases fall back
1060  on the default dispatcher.
1061  '''
1062  if len(a) == 3:
1063  t = type(a[-1])
1064  try:
1065  return self.mapping[t](*a)
1066  except KeyError:
1067  pass
1068  return self.func(*a)
1069 
string type
Definition: gaudirun.py:151

Member Data Documentation

GaudiPython.GaudiAlgs.TupleDecColumnDispatcher.__doc__
private

Definition at line 1048 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs.TupleDecColumnDispatcher.func

Definition at line 1047 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs.TupleDecColumnDispatcher.mapping

Definition at line 1054 of file GaudiAlgs.py.


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