The Gaudi Framework  v37r0 (b608885e)
GaudiKernel.Configurable.SuperAlgorithm Class Reference
Inheritance diagram for GaudiKernel.Configurable.SuperAlgorithm:
Collaboration diagram for GaudiKernel.Configurable.SuperAlgorithm:

Public Member Functions

def __new__ (cls, name=None, **kwargs)
 
def __init__ (self, name=None, **kwargs)
 
def name (self)
 
def getType (cls)
 
def properties (self)
 
def isApplicable (self)
 
def getGaudiType (cls)
 
def __repr__ (self)
 
def __setattr__ (self, name, value)
 
- Public Member Functions inherited from GaudiConfig.ControlFlow.ControlFlowNode
def __and__ (self, rhs)
 
def __or__ (self, rhs)
 
def __invert__ (self)
 
def __rshift__ (self, rhs)
 
def visitNode (self, visitor)
 
def __eq__ (self, other)
 
def __hash__ (self)
 
def getFullName (self)
 

Public Attributes

 graph
 

Private Member Functions

def _makeAlg (self, typ, **kwargs)
 
def _initGraph (self)
 
def _visitSubNodes (self, visitor)
 

Private Attributes

 _name
 

Detailed Description

Helper class to use a ControlFlowNode as an algorithm configurable
instance.

Definition at line 1851 of file Configurable.py.

Constructor & Destructor Documentation

◆ __init__()

def GaudiKernel.Configurable.SuperAlgorithm.__init__ (   self,
  name = None,
**  kwargs 
)

Definition at line 1873 of file Configurable.py.

1873  def __init__(self, name=None, **kwargs):
1874  self._name = name or self.getType()
1875  self.graph = self._initGraph()
1876  for key in kwargs:
1877  setattr(self, key, kwargs[key])
1878 

Member Function Documentation

◆ __new__()

def GaudiKernel.Configurable.SuperAlgorithm.__new__ (   cls,
  name = None,
**  kwargs 
)

Definition at line 1857 of file Configurable.py.

1857  def __new__(cls, name=None, **kwargs):
1858  if name is None:
1859  name = cls.__name__
1860  if name in Configurable.allConfigurables:
1861  instance = Configurable.allConfigurables[name]
1862  assert type(instance) is cls, (
1863  "trying to reuse {0!r} as name of a {1} instance while it"
1864  "s "
1865  "already used for an instance of {2}"
1866  ).format(name, cls.__name__, type(instance).__name__)
1867  return instance
1868  else:
1869  instance = super(SuperAlgorithm, cls).__new__(cls)
1870  Configurable.allConfigurables[name] = instance
1871  return instance
1872 

◆ __repr__()

def GaudiKernel.Configurable.SuperAlgorithm.__repr__ (   self)

Definition at line 1911 of file Configurable.py.

1911  def __repr__(self):
1912  return "{0}({1!r})".format(self.getType(), self.name)
1913 

◆ __setattr__()

def GaudiKernel.Configurable.SuperAlgorithm.__setattr__ (   self,
  name,
  value 
)

Definition at line 1918 of file Configurable.py.

1918  def __setattr__(self, name, value):
1919  super(SuperAlgorithm, self).__setattr__(name, value)
1920  if name in ("_name", "graph"):
1921  # do not propagate internal data members
1922  return
1923 
1924  class PropSetter(object):
1925  def enter(self, node):
1926  try:
1927  setattr(node, name, value)
1928  except (ValueError, AttributeError):
1929  # ignore type and name mismatch
1930  pass
1931 
1932  def leave(self, node):
1933  pass
1934 
1935  self._visitSubNodes(PropSetter())

◆ _initGraph()

def GaudiKernel.Configurable.SuperAlgorithm._initGraph (   self)
private

Reimplemented in SuperAlgDynamicGraph.MySuperAlg, and GaudiExamples.Configuration.Gaudi_Test_MySuperAlg.

Definition at line 1908 of file Configurable.py.

1908  def _initGraph(self):
1909  raise NotImplementedError()
1910 

◆ _makeAlg()

def GaudiKernel.Configurable.SuperAlgorithm._makeAlg (   self,
  typ,
**  kwargs 
)
private
Instantiate and algorithm of type 'typ' with a name suitable for use
inside a SuperAlgorithm.

Definition at line 1900 of file Configurable.py.

1900  def _makeAlg(self, typ, **kwargs):
1901  """
1902  Instantiate and algorithm of type 'typ' with a name suitable for use
1903  inside a SuperAlgorithm.
1904  """
1905  name = "{0}_{1}".format(self.name, kwargs.pop("name", typ.getType()))
1906  return typ(name, **kwargs)
1907 

◆ _visitSubNodes()

def GaudiKernel.Configurable.SuperAlgorithm._visitSubNodes (   self,
  visitor 
)
private

Reimplemented from GaudiConfig.ControlFlow.ControlFlowNode.

Definition at line 1914 of file Configurable.py.

1914  def _visitSubNodes(self, visitor):
1915  if self.graph:
1916  self.graph.visitNode(visitor)
1917 

◆ getGaudiType()

def GaudiKernel.Configurable.SuperAlgorithm.getGaudiType (   cls)

Definition at line 1897 of file Configurable.py.

1897  def getGaudiType(cls):
1898  return "User"
1899 

◆ getType()

def GaudiKernel.Configurable.SuperAlgorithm.getType (   cls)

Definition at line 1884 of file Configurable.py.

1884  def getType(cls):
1885  return cls.__name__
1886 

◆ isApplicable()

def GaudiKernel.Configurable.SuperAlgorithm.isApplicable (   self)

Definition at line 1892 of file Configurable.py.

1892  def isApplicable(self):
1893  return False
1894 

◆ name()

def GaudiKernel.Configurable.SuperAlgorithm.name (   self)

Definition at line 1880 of file Configurable.py.

1880  def name(self): # name is a read only property
1881  return self._name
1882 

◆ properties()

def GaudiKernel.Configurable.SuperAlgorithm.properties (   self)

Definition at line 1888 of file Configurable.py.

1888  def properties(self):
1889  pass
1890 

Member Data Documentation

◆ _name

GaudiKernel.Configurable.SuperAlgorithm._name
private

Definition at line 1874 of file Configurable.py.

◆ graph

GaudiKernel.Configurable.SuperAlgorithm.graph

Definition at line 1875 of file Configurable.py.


The documentation for this class was generated from the following file:
bug_34121.name
name
Definition: bug_34121.py:20
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
gaudiComponentHelp.properties
properties
Definition: gaudiComponentHelp.py:69
gaudirun.type
type
Definition: gaudirun.py:162
GaudiAlg.HistoUtils.__repr__
__repr__
Definition: HistoUtils.py:536