A wrapper which contains as much useful information as we can find about
a single object. Defined by this class: obj - the object being counted.
type - the class of the object, not necessarily type(obj).
size - the size of the object on its own.
children - a list of all objects referenced by this one.
times - a list of update times, which can be used to decide
when child objects first appeared in their parent objects.
The time for children[i] is at times[i].
wrappers - a reference back to the wrapper dictionary.
Annotations may add other fields - this might be changed soon, though.
Methods
|
|
|
|
__init__
|
__init__ ( self, obj )
Constructor. Does not fill out much because it will only
be called once.
|
|
__repr__
|
__repr__ ( self )
|
|
__str__
|
__str__ ( self )
|
|
addchild
|
addchild (
self,
child,
time,
)
Record another child of this object (see addchildren).
|
|
addchildren
|
addchildren (
self,
children,
times,
)
Record more children of this object.
children is a sequence of objects (not wrappers).
The update time for children[i] is taken from times[i].
|
|
copy
|
copy ( self )
Return a copy of this wrapper.
This shouldn't be used directly - call copy on the set of
wrappers instead (i.e. objs.copy() instead of objs[w].copy()).
|
|
cut
|
cut ( self, wrappers )
Remove any wrapper references which are not found in wrappers.
This will make the wrapper valid after removing other wrappers.
It's called by operations.cut.
|
|
droprefs
|
droprefs ( self, wrappers )
The opposite of liftrefs: transform wrapper references into
direct object references.
|
|
liftrefs
|
liftrefs ( self, wrappers )
Transform object references into wrapper references.
It's called by the scanner, and must not be called again.
|
|
scanfinished
|
scanfinished ( self, wrappers )
Called once all objects have been scanned, but before
liftrefs has been called.
|
|
show
|
show ( self, default=True )
Return a string representation of the object.
If default is false, will not include information from the
default implementation (type, address and so on).
|
|