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

Public Member Functions

def __init__
 
def __getattr__
 
def time
 
def isModule
 
def isEvent
 
def isMissing
 
def SetMissing
 
def __str__
 

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.

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

Member Function Documentation

def SortModuleTimes.EntryDataClass.__getattr__ (   self,
  attrName 
)

Definition at line 161 of file SortModuleTimes.py.

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

Definition at line 183 of file SortModuleTimes.py.

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

Definition at line 177 of file SortModuleTimes.py.

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

Definition at line 179 of file SortModuleTimes.py.

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

Definition at line 172 of file SortModuleTimes.py.

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

Definition at line 181 of file SortModuleTimes.py.

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

Definition at line 167 of file SortModuleTimes.py.

168  def time(self):
169  try: return self.data['time']
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: