Public Member Functions | Public Attributes | List of all members
SortModuleTimes.EntryDataClass Class Reference
Inheritance diagram for SortModuleTimes.EntryDataClass:

Public Member Functions

def __init__ (self, eventKey, kargs)
 
def __getattr__ (self, attrName)
 
def time (self)
 
def isModule (self)
 
def isEvent (self)
 
def isMissing (self)
 
def SetMissing (self)
 
def __str__ (self)
 

Public Attributes

 data
 
 eventKey
 

Detailed Description

A flexible data structure for per-event information.

The object is associated to a specific, unique event.
It can represent either the execution of the full event, or of a specific
module on that event.
The object gathers custom data; the standard data members:
- time (default: None): seconds elapsed by the event
- module (default: not defined): the module identification
If time is None, we assume this event was never completed.
The presence of a module data member implies that this object descrivbes a
module execution rather than the whole event.

Definition at line 142 of file SortModuleTimes.py.

Constructor & Destructor Documentation

def SortModuleTimes.EntryDataClass.__init__ (   self,
  eventKey,
  kargs 
)

Definition at line 155 of file SortModuleTimes.py.

155  def __init__(self, eventKey, **kargs):
156  self.data = kargs
157  self.data.setdefault('time', None)
158  self.eventKey = eventKey
def __init__(self, eventKey, kargs)

Member Function Documentation

def SortModuleTimes.EntryDataClass.__getattr__ (   self,
  attrName 
)

Definition at line 161 of file SortModuleTimes.py.

161  def __getattr__(self, attrName):
162  # we expect this will be called only if no attrName already exists
163  try: return self.data[attrName]
164  except KeyError: raise AttributeError(attrName)
def __getattr__(self, attrName)
def SortModuleTimes.EntryDataClass.__str__ (   self)

Definition at line 183 of file SortModuleTimes.py.

183  def __str__(self):
184  s = str(self.eventKey)
185  if self.isModule(): s += " module " + str(self.module)
186  else: s += " event"
187  s += ": ";
188  if self.time() is None: s += "(n/a)"
189  else: s += "%g s" % self.time()
190  return s
static QCString str
def SortModuleTimes.EntryDataClass.isEvent (   self)

Definition at line 177 of file SortModuleTimes.py.

177  def isEvent(self): return not self.isModule()
178 
def SortModuleTimes.EntryDataClass.isMissing (   self)

Definition at line 179 of file SortModuleTimes.py.

179  def isMissing(self): return self.time() is None
180 
def SortModuleTimes.EntryDataClass.isModule (   self)

Definition at line 172 of file SortModuleTimes.py.

172  def isModule(self):
173  try: return bool(self.module)
174  except AttributeError: return False
def SortModuleTimes.EntryDataClass.SetMissing (   self)

Definition at line 181 of file SortModuleTimes.py.

181  def SetMissing(self): self.data['time'] = None
182 
def SortModuleTimes.EntryDataClass.time (   self)

Definition at line 167 of file SortModuleTimes.py.

167  def time(self):
168  try: return self.data['time']
169  except KeyError: return None

Member Data Documentation

SortModuleTimes.EntryDataClass.data

Definition at line 156 of file SortModuleTimes.py.

SortModuleTimes.EntryDataClass.eventKey

Definition at line 158 of file SortModuleTimes.py.


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