The Gaudi Framework  v37r0 (b608885e)
GaudiAlg.Algs.TupleDecColumnDispatcher Class Reference
Inheritance diagram for GaudiAlg.Algs.TupleDecColumnDispatcher:
Collaboration diagram for GaudiAlg.Algs.TupleDecColumnDispatcher:

Public Member Functions

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 1178 of file Algs.py.

Constructor & Destructor Documentation

◆ __init__()

def GaudiAlg.Algs.TupleDecColumnDispatcher.__init__ (   self,
  func 
)

Definition at line 1181 of file Algs.py.

1181  def __init__(self, func):
1182  self.func = func
1183  self.__doc__ = func.__doc__
1184  dispatcher = func.disp if hasattr(func, "disp") else func.__overload__
1185 
1186  mapping = {int: "int", bool: "bool", float: "double"}
1187  for k in mapping:
1188  signature = (
1189  "const Tuples::Tuple& tuple, const string& name, const %s value"
1190  % (mapping[k])
1191  )
1192  mapping[k] = dispatcher(signature)
1193  self.mapping = mapping
1194 

Member Function Documentation

◆ __call__()

def GaudiAlg.Algs.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 1195 of file Algs.py.

1195  def __call__(self, *a):
1196  """
1197  Explicitly call the explicit signature for the case with 3 arguments and
1198  the last one is 'int', 'bool' or 'float', for the other cases fall back
1199  on the default dispatcher.
1200  """
1201  if len(a) == 3:
1202  t = type(a[-1])
1203  try:
1204  return self.mapping[t](*a)
1205  except KeyError:
1206  pass
1207  return self.func(*a)
1208 
1209 

Member Data Documentation

◆ __doc__

GaudiAlg.Algs.TupleDecColumnDispatcher.__doc__
private

Definition at line 1183 of file Algs.py.

◆ func

GaudiAlg.Algs.TupleDecColumnDispatcher.func

Definition at line 1182 of file Algs.py.

◆ mapping

GaudiAlg.Algs.TupleDecColumnDispatcher.mapping

Definition at line 1193 of file Algs.py.


The documentation for this class was generated from the following file:
gaudirun.type
type
Definition: gaudirun.py:162