/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::ObjectHandle Class Reference

List of all members.

Public Member Functions

def __init__
def copy
def accept
def release
def object
def location
def __getattr__
def __del__

Private Attributes

 _obj
 _loc

Detailed Description

A class to provide implicit ref counting to a DataObject.

It also stores a location string.

It is assumed that the object has had the function:

  GaudiPython.gbl.SetOwnership(roh, False)

called on it.

Definition at line 8 of file handle.py.


Constructor & Destructor Documentation

def DybEventMgr::handle::ObjectHandle::__init__ (   self,
  obj,
  loc = None 
)

Definition at line 20 of file handle.py.

00021                                    :
00022         'Handle the given object an location.  If another ObjectHandle is given a copy is made'
00023         if not loc and type(obj) == ObjectHandle:
00024             self.copy(obj)
00025             return
00026 
00027         self._obj = None
00028         self._loc = None
00029         if obj: self.accept(obj,loc)
00030         return

def DybEventMgr::handle::ObjectHandle::__del__ (   self)

Definition at line 71 of file handle.py.

00072                      :
00073         #print 'Handle deleting, releasing object @ %s with %d counts' % (self._loc,self._obj.refCount())
00074         self.release()


Member Function Documentation

def DybEventMgr::handle::ObjectHandle::copy (   self,
  oh 
)

Definition at line 31 of file handle.py.

00032                      :
00033         'Make a copy of an ObjectHandle'
00034         self._obj = oh.object()
00035         self._obj.addRef()
00036         self._loc = oh.location()
00037         return

def DybEventMgr::handle::ObjectHandle::accept (   self,
  obj,
  loc 
)

Definition at line 38 of file handle.py.

00039                             :
00040         'Accept an object and location, releases and returns any pre-existing pair.'
00041         ret = self.release()
00042         obj.addRef()
00043         self._obj = obj
00044         self._loc = loc
00045         return ret

def DybEventMgr::handle::ObjectHandle::release (   self)

Definition at line 46 of file handle.py.

00047                      :
00048         'Release and return a managed (object,location) pair.  Can trigger deletion of the object'
00049         if not self._obj: return ()
00050         obj = self._obj
00051         loc = self._loc
00052         self._obj = None
00053         count = obj.refCount()
00054         obj.release()
00055         if count == 1:          # underlying DataObject
00056             del obj             # is now deleted so
00057             obj = None          # save the user some heartache
00058         return (obj,loc)

def DybEventMgr::handle::ObjectHandle::object (   self)

Definition at line 59 of file handle.py.

00060                     :
00061         'Return but do not release the object.'
00062         return self._obj

def DybEventMgr::handle::ObjectHandle::location (   self)

Definition at line 63 of file handle.py.

00064                       :
00065         'Return the location'
00066         return self._loc

def DybEventMgr::handle::ObjectHandle::__getattr__ (   self,
  name 
)

Definition at line 67 of file handle.py.

00068                               :
00069         'PImpl'
00070         return self._obj.__getattribute__(name)


Member Data Documentation

Definition at line 20 of file handle.py.

Definition at line 20 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