/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Private Attributes
DybEventMgr::handle::HandleCache Class Reference

List of all members.

Public Member Functions

def __init__
def __len__
def handles
def push
def pop
def derived

Private Attributes

 _raw_hos
 _handles

Detailed Description

Definition at line 75 of file handle.py.


Constructor & Destructor Documentation

def DybEventMgr::handle::HandleCache::__init__ (   self)

Definition at line 77 of file handle.py.

00078                       :
00079         self._raw_hos = []
00080         self._handles = []
00081         return


Member Function Documentation

def DybEventMgr::handle::HandleCache::__len__ (   self)

Definition at line 82 of file handle.py.

00083                      :
00084         return len(self._handles)

def DybEventMgr::handle::HandleCache::handles (   self)

Definition at line 85 of file handle.py.

00086                      :
00087         'An iterable returning handles'
00088         for handle in self._handles:
00089             yield handle
00090         return

def DybEventMgr::handle::HandleCache::push (   self,
  obj,
  path = None 
)

Definition at line 91 of file handle.py.

00092                                 :
00093         'Add ObjectHandle or object+path'
00094         handle = obj
00095         if type(obj) == ObjectHandle:
00096             obj = handle.object()
00097         else:
00098             handle = ObjectHandle(obj,path)
00099         if obj in self._raw_hos: return
00100         self._raw_hos.append(obj)
00101         self._handles.append(handle)
00102         return

def DybEventMgr::handle::HandleCache::pop (   self,
  obj 
)
Remove and return obj from cache or None not found.  The
obj can be a HeaderObject or an ObjectHandle

Definition at line 103 of file handle.py.

00104                      :
00105         '''Remove and return obj from cache or None not found.  The
00106         obj can be a HeaderObject or an ObjectHandle'''
00107         if type(obj) == ObjectHandle:
00108             obj = obj.object()
00109         try:
00110             ind = self._raw_hos.index(obj)
00111         except ValueError:
00112             return None
00113         self._raw_hos.pop(ind)
00114         handle = self._handles.pop(ind)
00115         #print 'Popping index %d of %d: %s #%d' % (ind,len(self._handles),handle.location(),handle.object().execNumber())
00116         return handle

def DybEventMgr::handle::HandleCache::derived (   self,
  obj 
)
Return a list of ObjectHandles that can reach obj through
their input headers.  Returned handles are popped from the cache

Definition at line 117 of file handle.py.

00118                          :
00119         '''Return a list of ObjectHandles that can reach obj through
00120         their input headers.  Returned handles are popped from the cache'''
00121         if type(obj) == ObjectHandle:
00122             obj = obj.object()
00123 
00124         found = []
00125         for ind,handle in enumerate(self._handles):
00126             if isfrom(handle.object(),obj):
00127                 found.append(handle)
00128                 pass
00129             continue
00130 
00131         #print 'Got %d derived' % len(found)
00132         for todie in found:
00133             self.pop(todie)
00134         return found


Member Data Documentation

Definition at line 77 of file handle.py.

Definition at line 77 of file handle.py.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 10:09:08 for DybEventMgr by doxygen 1.7.4