CMS 3D CMS Logo

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__ (self, *chainedModifiers)
 
def copyAndExclude (self, toExclude)
 

Private Member Functions

def __copyIfExclude (self, toExclude)
 
def _applyNewProcessModifiers (self, process)
 
def _isChosen (self)
 
def _isOrContains (self, other)
 
def _setChosen (self)
 

Private Attributes

 __chain
 
 __chosen
 

Detailed Description

A Modifier made up of a list of Modifiers

Definition at line 1672 of file Config.py.

Constructor & Destructor Documentation

◆ __init__()

def Config.ModifierChain.__init__ (   self,
chainedModifiers 
)

Definition at line 1675 of file Config.py.

1675  def __init__(self, *chainedModifiers):
1676  self.__chosen = False
1677  self.__chain = chainedModifiers

Member Function Documentation

◆ __copyIfExclude()

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

Definition at line 1704 of file Config.py.

1704  def __copyIfExclude(self,toExclude):
1705  shouldCopy = False
1706  for m in toExclude:
1707  if self._isOrContains(m):
1708  shouldCopy = True
1709  break
1710  if shouldCopy:
1711  return self.copyAndExclude(toExclude)
1712  return self

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

◆ _applyNewProcessModifiers()

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

1678  def _applyNewProcessModifiers(self,process):
1679  """Should only be called by cms.Process instances
1680  applies list of accumulated changes to the process"""
1681  for m in self.__chain:
1682  m._applyNewProcessModifiers(process)

References Config.ModifierChain.__chain.

◆ _isChosen()

def Config.ModifierChain._isChosen (   self)
private

Definition at line 1688 of file Config.py.

1688  def _isChosen(self):
1689  return self.__chosen

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

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

◆ _isOrContains()

def Config.ModifierChain._isOrContains (   self,
  other 
)
private

Definition at line 1713 of file Config.py.

1713  def _isOrContains(self, other):
1714  if self is other:
1715  return True
1716  for m in self.__chain:
1717  if m._isOrContains(other):
1718  return True
1719  return False
1720 

References Config.ModifierChain.__chain.

Referenced by Config.ModifierChain.__copyIfExclude().

◆ _setChosen()

def Config.ModifierChain._setChosen (   self)
private
Should only be called by cms.Process instances

Definition at line 1683 of file Config.py.

1683  def _setChosen(self):
1684  """Should only be called by cms.Process instances"""
1685  self.__chosen = True
1686  for m in self.__chain:
1687  m._setChosen()

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

◆ copyAndExclude()

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

1690  def copyAndExclude(self, toExclude):
1691  """Creates a new ModifierChain which is a copy of
1692  this ModifierChain but excludes any Modifier or
1693  ModifierChain in the list toExclude.
1694  The exclusion is done recursively down the chain.
1695  """
1696  newMods = []
1697  for m in self.__chain:
1698  if m not in toExclude:
1699  s = m
1700  if isinstance(m,ModifierChain):
1701  s = m.__copyIfExclude(toExclude)
1702  newMods.append(s)
1703  return ModifierChain(*newMods)

References Config.ModifierChain.__chain.

Referenced by Config.ModifierChain.__copyIfExclude().

Member Data Documentation

◆ __chain

Config.ModifierChain.__chain
private

◆ __chosen

Config.ModifierChain.__chosen
private

Definition at line 1676 of file Config.py.

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