Module Cerealizer :: Class ObjHandler
[hide private]
[frames] | no frames]

Class ObjHandler

source code

object --+    
         |    
   Handler --+
             |
            ObjHandler
Known Subclasses:
InitArgsObjHandler, NewArgsObjHandler, SlotedObjHandler

ObjHandler

A Cerealizer Handler that can support any new-style class instances, old-style class instances as well as C-defined types (although it may not save the C-side data).

Instance Methods [hide private]
 
__init__(self, Class, classname='')
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
collect(self, obj, dumper)
Collects all the objects referenced by OBJ.
source code
 
dump_data(self, obj, dumper, s)
Dumps OBJ data in file S.
source code
 
undump_obj(self, dumper, s)
Returns a new uninitialized (=no __init__'ed) instance of the class.
source code
 
undump_data(self, obj, dumper, s)
Reads the data for OBJ, from DUMPER and file S.
source code

Inherited from Handler: dump_obj, dump_ref

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, Class, classname='')
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__
(inherited documentation)

collect(self, obj, dumper)

source code 
Collects all the objects referenced by OBJ. For each objects ROBJ referenced by OBJ, calls collect method of the Handler for ROBJ's class, i.e._HANDLERS_[ROBJ.__class__].collect(ROBJ, dumper). Returns false if OBJ is already referenced (and thus no collection should occur); else returns true.
Returns:
bool

Overrides: Handler.collect
(inherited documentation)

dump_data(self, obj, dumper, s)

source code 
Dumps OBJ data in file S.
Overrides: Handler.dump_data
(inherited documentation)

undump_obj(self, dumper, s)

source code 
Returns a new uninitialized (=no __init__'ed) instance of the class. If you override undump_obj, DUMPER and file S can be used to read additional data saved by Handler.dump_obj().
Overrides: Handler.undump_obj
(inherited documentation)

undump_data(self, obj, dumper, s)

source code 
Reads the data for OBJ, from DUMPER and file S. If you override undump_data, you should use DUMPER.undump_ref(S) to read a reference or a basic type (=a string, an int,...).
Overrides: Handler.undump_data
(inherited documentation)