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 1046 of file GaudiAlgs.py.

Constructor & Destructor Documentation

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

Definition at line 1048 of file GaudiAlgs.py.

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

Definition at line 1048 of file GaudiAlgs.py.

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

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 1058 of file GaudiAlgs.py.

1058  def __call__(self, *a):
1059  '''
1060  Explicitly call the explicit signature for the case with 3 arguments and
1061  the last one is 'int', 'bool' or 'float', for the other cases fall back
1062  on the default dispatcher.
1063  '''
1064  if len(a) == 3:
1065  t = type(a[-1])
1066  try:
1067  return self.mapping[t](*a)
1068  except KeyError:
1069  pass
1070  return self.func(*a)
1071 
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 1058 of file GaudiAlgs.py.

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

Member Data Documentation

GaudiPython.GaudiAlgs.TupleDecColumnDispatcher.__doc__
private

Definition at line 1050 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs.TupleDecColumnDispatcher.func

Definition at line 1049 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs.TupleDecColumnDispatcher.mapping

Definition at line 1056 of file GaudiAlgs.py.


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