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 1762 of file Config.py.

Constructor & Destructor Documentation

def Config.ModifierChain.__init__ (   self,
  chainedModifiers 
)

Definition at line 1765 of file Config.py.

1766  def __init__(self, *chainedModifiers):
1767  self.__chosen = False
self.__chain = chainedModifiers

Member Function Documentation

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

Definition at line 1794 of file Config.py.

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

1795  def __copyIfExclude(self,toExclude):
1796  shouldCopy = False
1797  for m in toExclude:
1798  if self._isOrContains(m):
1799  shouldCopy = True
1800  break
1801  if shouldCopy:
1802  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 1768 of file Config.py.

References Config.ModifierChain.__chain.

1769  def _applyNewProcessModifiers(self,process):
1770  """Should only be called by cms.Process instances
1771  applies list of accumulated changes to the process"""
1772  for m in self.__chain:
m._applyNewProcessModifiers(process)
def _applyNewProcessModifiers
Definition: Config.py:1768
def Config.ModifierChain._isChosen (   self)
private

Definition at line 1778 of file Config.py.

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

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

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

Definition at line 1803 of file Config.py.

References Config.ModifierChain.__chain.

Referenced by Config.ModifierChain.__copyIfExclude().

1804  def _isOrContains(self, other):
1805  if self is other:
1806  return True
1807  for m in self.__chain:
1808  if m._isOrContains(other):
1809  return True
1810  return False
def Config.ModifierChain._setChosen (   self)
private
Should only be called by cms.Process instances

Definition at line 1773 of file Config.py.

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

1774  def _setChosen(self):
1775  """Should only be called by cms.Process instances"""
1776  self.__chosen = True
1777  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 1780 of file Config.py.

References Config.ModifierChain.__chain.

Referenced by Config.ModifierChain.__copyIfExclude().

1781  def copyAndExclude(self, toExclude):
1782  """Creates a new ModifierChain which is a copy of
1783  this ModifierChain but excludes any Modifier or
1784  ModifierChain in the list toExclude.
1785  The exclusion is done recursively down the chain.
1786  """
1787  newMods = []
1788  for m in self.__chain:
1789  if m not in toExclude:
1790  s = m
1791  if isinstance(m,ModifierChain):
1792  s = m.__copyIfExclude(toExclude)
1793  newMods.append(s)
return ModifierChain(*newMods)

Member Data Documentation

Config.ModifierChain.__chain
private

Definition at line 1767 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 1766 of file Config.py.

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