CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
Config.ModifierChain Class Reference
Inheritance diagram for Config.ModifierChain:

Public Member Functions

def __init__
 
def copyAndExclude
 

Private Member Functions

def __copyIfExclude
 
def _applyNewProcessModifiers
 
def _isChosen
 
def _isOrContains
 
def _setChosen
 

Private Attributes

 __chain
 
 __chosen
 

Detailed Description

A Modifier made up of a list of Modifiers

Definition at line 1815 of file Config.py.

Constructor & Destructor Documentation

def Config.ModifierChain.__init__ (   self,
  chainedModifiers 
)

Definition at line 1818 of file Config.py.

1819  def __init__(self, *chainedModifiers):
1820  self.__chosen = False
self.__chain = chainedModifiers

Member Function Documentation

def Config.ModifierChain.__copyIfExclude (   self,
  toExclude 
)
private

Definition at line 1847 of file Config.py.

References Config.Modifier._isOrContains(), Config.ModifierChain._isOrContains(), and Config.ModifierChain.copyAndExclude().

1848  def __copyIfExclude(self,toExclude):
1849  shouldCopy = False
1850  for m in toExclude:
1851  if self._isOrContains(m):
1852  shouldCopy = True
1853  break
1854  if shouldCopy:
1855  return self.copyAndExclude(toExclude)
return self
def Config.ModifierChain._applyNewProcessModifiers (   self,
  process 
)
private
Should only be called by cms.Process instances
applies list of accumulated changes to the process

Definition at line 1821 of file Config.py.

References Config.ModifierChain.__chain.

1822  def _applyNewProcessModifiers(self,process):
1823  """Should only be called by cms.Process instances
1824  applies list of accumulated changes to the process"""
1825  for m in self.__chain:
m._applyNewProcessModifiers(process)
def _applyNewProcessModifiers
Definition: Config.py:1821
def Config.ModifierChain._isChosen (   self)
private

Definition at line 1831 of file Config.py.

References Config.Modifier.__chosen, and Config.ModifierChain.__chosen.

Referenced by Config._BoolModifierBase.toModify(), and Config._BoolModifierBase.toReplaceWith().

1832  def _isChosen(self):
return self.__chosen
def Config.ModifierChain._isOrContains (   self,
  other 
)
private

Definition at line 1856 of file Config.py.

References Config.ModifierChain.__chain.

Referenced by Config.ModifierChain.__copyIfExclude().

1857  def _isOrContains(self, other):
1858  if self is other:
1859  return True
1860  for m in self.__chain:
1861  if m._isOrContains(other):
1862  return True
1863  return False
def Config.ModifierChain._setChosen (   self)
private
Should only be called by cms.Process instances

Definition at line 1826 of file Config.py.

References Config.ModifierChain.__chain, Config.Modifier.__chosen, and Config.ModifierChain.__chosen.

1827  def _setChosen(self):
1828  """Should only be called by cms.Process instances"""
1829  self.__chosen = True
1830  for m in self.__chain:
m._setChosen()
def Config.ModifierChain.copyAndExclude (   self,
  toExclude 
)
Creates a new ModifierChain which is a copy of
  this ModifierChain but excludes any Modifier or
  ModifierChain in the list toExclude.
  The exclusion is done recursively down the chain.

Definition at line 1833 of file Config.py.

References Config.ModifierChain.__chain.

Referenced by Config.ModifierChain.__copyIfExclude().

1834  def copyAndExclude(self, toExclude):
1835  """Creates a new ModifierChain which is a copy of
1836  this ModifierChain but excludes any Modifier or
1837  ModifierChain in the list toExclude.
1838  The exclusion is done recursively down the chain.
1839  """
1840  newMods = []
1841  for m in self.__chain:
1842  if m not in toExclude:
1843  s = m
1844  if isinstance(m,ModifierChain):
1845  s = m.__copyIfExclude(toExclude)
1846  newMods.append(s)
return ModifierChain(*newMods)

Member Data Documentation

Config.ModifierChain.__chain
private

Definition at line 1820 of file Config.py.

Referenced by Config.ModifierChain._applyNewProcessModifiers(), Config.ModifierChain._isOrContains(), Config.ModifierChain._setChosen(), and Config.ModifierChain.copyAndExclude().

Config.ModifierChain.__chosen
private

Definition at line 1819 of file Config.py.

Referenced by Config.ModifierChain._isChosen(), and Config.ModifierChain._setChosen().