The Gaudi Framework  v41r0 (bdbe7744)
Loading...
Searching...
No Matches
GaudiKernel.Configurable.SuperAlgorithm Class Reference
Inheritance diagram for GaudiKernel.Configurable.SuperAlgorithm:
Collaboration diagram for GaudiKernel.Configurable.SuperAlgorithm:

Public Member Functions

 __new__ (cls, name=None, **kwargs)
 __init__ (self, name=None, **kwargs)
 name (self)
 getType (cls)
 properties (self)
 isApplicable (self)
 getGaudiType (cls)
 __repr__ (self)
 __setattr__ (self, name, value)

Public Attributes

 graph = self._initGraph()

Protected Member Functions

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

Protected Attributes

 _name = name or self.getType()

Detailed Description

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

Definition at line 1842 of file Configurable.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 1864 of file Configurable.py.

1864 def __init__(self, name=None, **kwargs):
1865 self._name = name or self.getType()
1866 self.graph = self._initGraph()
1867 for key in kwargs:
1868 setattr(self, key, kwargs[key])
1869

Member Function Documentation

◆ __new__()

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

Definition at line 1848 of file Configurable.py.

1848 def __new__(cls, name=None, **kwargs):
1849 if name is None:
1850 name = cls.__name__
1851 if name in Configurable.allConfigurables:
1852 instance = Configurable.allConfigurables[name]
1853 assert type(instance) is cls, (
1854 f"trying to reuse {name!r} as name of a {cls.__name__} instance while it"
1855 "s "
1856 f"already used for an instance of {type(instance).__name__}"
1857 )
1858 return instance
1859 else:
1860 instance = super().__new__(cls)
1861 Configurable.allConfigurables[name] = instance
1862 return instance
1863

◆ __repr__()

GaudiKernel.Configurable.SuperAlgorithm.__repr__ ( self)

Definition at line 1902 of file Configurable.py.

1902 def __repr__(self):
1903 return f"{self.getType()}({self.name!r})"
1904

◆ __setattr__()

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

Definition at line 1909 of file Configurable.py.

1909 def __setattr__(self, name, value):
1910 super().__setattr__(name, value)
1911 if name in ("_name", "graph"):
1912 # do not propagate internal data members
1913 return
1914
1915 class PropSetter:
1916 def enter(self, node):
1917 try:
1918 setattr(node, name, value)
1919 except (ValueError, AttributeError):
1920 # ignore type and name mismatch
1921 pass
1922
1923 def leave(self, node):
1924 pass
1925
1926 self._visitSubNodes(PropSetter())

◆ _initGraph()

GaudiKernel.Configurable.SuperAlgorithm._initGraph ( self)
protected

Reimplemented in Configuration.Gaudi_Test_MySuperAlg, and SuperAlgDynamicGraph.MySuperAlg.

Definition at line 1899 of file Configurable.py.

1899 def _initGraph(self):
1900 raise NotImplementedError()
1901

◆ _makeAlg()

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

Definition at line 1891 of file Configurable.py.

1891 def _makeAlg(self, typ, **kwargs):
1892 """
1893 Instantiate and algorithm of type 'typ' with a name suitable for use
1894 inside a SuperAlgorithm.
1895 """
1896 name = "{}_{}".format(self.name, kwargs.pop("name", typ.getType()))
1897 return typ(name, **kwargs)
1898
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition MsgStream.cpp:93

◆ _visitSubNodes()

GaudiKernel.Configurable.SuperAlgorithm._visitSubNodes ( self,
visitor )
protected

Definition at line 1905 of file Configurable.py.

1905 def _visitSubNodes(self, visitor):
1906 if self.graph:
1907 self.graph.visitNode(visitor)
1908

◆ getGaudiType()

GaudiKernel.Configurable.SuperAlgorithm.getGaudiType ( cls)

Definition at line 1888 of file Configurable.py.

1888 def getGaudiType(cls):
1889 return "User"
1890

◆ getType()

GaudiKernel.Configurable.SuperAlgorithm.getType ( cls)

Definition at line 1875 of file Configurable.py.

1875 def getType(cls):
1876 return cls.__name__
1877

◆ isApplicable()

GaudiKernel.Configurable.SuperAlgorithm.isApplicable ( self)

Definition at line 1883 of file Configurable.py.

1883 def isApplicable(self):
1884 return False
1885

◆ name()

GaudiKernel.Configurable.SuperAlgorithm.name ( self)

Definition at line 1871 of file Configurable.py.

1871 def name(self): # name is a read only property
1872 return self._name
1873

◆ properties()

GaudiKernel.Configurable.SuperAlgorithm.properties ( self)

Definition at line 1879 of file Configurable.py.

1879 def properties(self):
1880 pass
1881

Member Data Documentation

◆ _name

GaudiKernel.Configurable.SuperAlgorithm._name = name or self.getType()
protected

Definition at line 1865 of file Configurable.py.

◆ graph

GaudiKernel.Configurable.SuperAlgorithm.graph = self._initGraph()

Definition at line 1866 of file Configurable.py.


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