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 | Public Attributes
OrderedSet.OrderedSet Class Reference
Inheritance diagram for OrderedSet.OrderedSet:

Public Member Functions

def __contains__
 
def __eq__
 
def __init__
 
def __iter__
 
def __len__
 
def __repr__
 
def __reversed__
 
def add
 
def discard
 
def pop
 

Public Attributes

 end
 
 map
 

Detailed Description

Definition at line 29 of file OrderedSet.py.

Constructor & Destructor Documentation

def OrderedSet.OrderedSet.__init__ (   self,
  iterable = None 
)

Definition at line 31 of file OrderedSet.py.

31 
32  def __init__(self, iterable=None):
33  self.end = end = []
34  end += [None, end, end] # sentinel node for doubly linked list
35  self.map = {} # key --> [key, prev, next]
36  if iterable is not None:
37  self |= iterable

Member Function Documentation

def OrderedSet.OrderedSet.__contains__ (   self,
  key 
)

Definition at line 41 of file OrderedSet.py.

References OrderedSet.OrderedSet.map, HcalEmap.map, EMap.map, and cscdqm::Summary.map.

41 
42  def __contains__(self, key):
43  return key in self.map
def OrderedSet.OrderedSet.__eq__ (   self,
  other 
)

Definition at line 82 of file OrderedSet.py.

Referenced by SequenceTypes._UnarySequenceOperator.__ne__().

82 
83  def __eq__(self, other):
84  if isinstance(other, OrderedSet):
85  return len(self) == len(other) and list(self) == list(other)
86  return set(self) == set(other)
87 
def OrderedSet.OrderedSet.__iter__ (   self)

Definition at line 56 of file OrderedSet.py.

References OrderedSet.OrderedSet.end, poly< T >::const_iterator.end, edm::IDVectorMap< ID, C, P >::range.end, validateAlignments.ValidationJob.end, cond::RunInfo_t.end, validateAlignments.ValidationJobMultiIOV.end, o2olib.O2ORunMgr.end, esMonitoring.FDOutputListener.end, LHCInfoImpl::LumiSectionFilter.end, and svgfig.LineAxis.end.

56 
57  def __iter__(self):
58  end = self.end
59  curr = end[2]
60  while curr is not end:
61  yield curr[0]
62  curr = curr[2]
def OrderedSet.OrderedSet.__len__ (   self)

Definition at line 38 of file OrderedSet.py.

References OrderedSet.OrderedSet.map, HcalEmap.map, EMap.map, and cscdqm::Summary.map.

38 
39  def __len__(self):
40  return len(self.map)
def OrderedSet.OrderedSet.__repr__ (   self)

Definition at line 77 of file OrderedSet.py.

77 
78  def __repr__(self):
79  if not self:
80  return '%s()' % (self.__class__.__name__,)
81  return '%s(%r)' % (self.__class__.__name__, list(self))
def OrderedSet.OrderedSet.__reversed__ (   self)

Definition at line 63 of file OrderedSet.py.

References OrderedSet.OrderedSet.end, poly< T >::const_iterator.end, edm::IDVectorMap< ID, C, P >::range.end, validateAlignments.ValidationJob.end, cond::RunInfo_t.end, validateAlignments.ValidationJobMultiIOV.end, o2olib.O2ORunMgr.end, esMonitoring.FDOutputListener.end, LHCInfoImpl::LumiSectionFilter.end, and svgfig.LineAxis.end.

63 
64  def __reversed__(self):
65  end = self.end
66  curr = end[1]
67  while curr is not end:
68  yield curr[0]
69  curr = curr[1]
def OrderedSet.OrderedSet.add (   self,
  key 
)

Definition at line 44 of file OrderedSet.py.

References OrderedSet.OrderedSet.end, poly< T >::const_iterator.end, edm::IDVectorMap< ID, C, P >::range.end, validateAlignments.ValidationJob.end, cond::RunInfo_t.end, validateAlignments.ValidationJobMultiIOV.end, o2olib.O2ORunMgr.end, esMonitoring.FDOutputListener.end, LHCInfoImpl::LumiSectionFilter.end, svgfig.LineAxis.end, OrderedSet.OrderedSet.map, HcalEmap.map, EMap.map, and cscdqm::Summary.map.

Referenced by counter.Counter.register(), SequenceTypes.Task.remove(), and SequenceTypes.Task.replace().

44 
45  def add(self, key):
46  if key not in self.map:
47  end = self.end
48  curr = end[1]
49  curr[2] = end[1] = self.map[key] = [key, curr, end]
def OrderedSet.OrderedSet.discard (   self,
  key 
)

Definition at line 50 of file OrderedSet.py.

References OrderedSet.OrderedSet.map, HcalEmap.map, EMap.map, and cscdqm::Summary.map.

Referenced by OrderedSet.OrderedSet.pop().

50 
51  def discard(self, key):
52  if key in self.map:
53  key, prev, next = self.map.pop(key)
54  prev[2] = next
55  next[1] = prev
def OrderedSet.OrderedSet.pop (   self,
  last = True 
)

Definition at line 70 of file OrderedSet.py.

References OrderedSet.OrderedSet.discard(), DQMNet.discard(), OrderedSet.OrderedSet.end, poly< T >::const_iterator.end, edm::IDVectorMap< ID, C, P >::range.end, validateAlignments.ValidationJob.end, cond::RunInfo_t.end, validateAlignments.ValidationJobMultiIOV.end, o2olib.O2ORunMgr.end, esMonitoring.FDOutputListener.end, LHCInfoImpl::LumiSectionFilter.end, and svgfig.LineAxis.end.

Referenced by SequenceTypes.Schedule._replaceIfHeldDirectly().

70 
71  def pop(self, last=True):
72  if not self:
73  raise KeyError('set is empty')
74  key = self.end[1][0] if last else self.end[2][0]
75  self.discard(key)
76  return key

Member Data Documentation

OrderedSet.OrderedSet.end

Definition at line 32 of file OrderedSet.py.

Referenced by OrderedSet.OrderedSet.__iter__(), OrderedSet.OrderedSet.__reversed__(), OrderedSet.OrderedSet.add(), Types.LuminosityBlockRange.cppID(), Types.EventRange.cppID(), and OrderedSet.OrderedSet.pop().

OrderedSet.OrderedSet.map

Definition at line 34 of file OrderedSet.py.

Referenced by OrderedSet.OrderedSet.__contains__(), OrderedSet.OrderedSet.__len__(), OrderedSet.OrderedSet.add(), and OrderedSet.OrderedSet.discard().