Review Board 2.0.15


SimObject: add export_method* hooks to export C++ methods to Python

Review Request #877 - Created Sept. 24, 2011 and submitted

Information
Steve Reinhardt
gem5
Reviewers
Default
ali, gblack, nate, stever
SimObject: add export_method* hooks to export C++ methods to Python

Replace the (broken as of previous changeset) swig_objdecl() method
that allowed/forced you to substitute a whole new C++ struct
definition for SWIG to wrap with a set of export_method* hooks
that let you just declare a set of C++ methods (or other declarations)
that get inserted in the auto-generated struct.

Restore the System get/setMemoryMode methods, and use this mechanism
to specialize SimObject as well, eliminating teh need for sim_object.i.
Needed bits of sim_object.i are moved to the new pyobject.i.
Also sucked a little SimObject specialization into cxx_param_decl()
allowing us to get rid of src/sim/sim_object_params.hh.  Now the
generation and wrapping of the base SimObject param struct is more
in line with how derived objects are handled.

   
Posted (Sept. 24, 2011, 10:30 a.m.)
Still don't know what's going on, still looks ok :-). I didn't see anything that bothered me in this, but I don't know what it's doing either.
Ship it!
Posted (Sept. 25, 2011, 1:43 p.m.)
I'm ambivalent about this change.  What I'd really rather see is that we just wrap all sim objects and use #ifndef SWIG for the parts that cause us problems.
  1. Yea, that sounds nice in theory, but I'm scared to try it in practice... just seems like it could be a real rathole of figuring out what to #ifdef and what to let swig chew on.
    
    IMO this is a definite improvement over the current method though.