passig lifetime control to C++

jochen jochen.heckl at novatrix.de
Mon Jan 20 12:00:00 EST 2003


I have class EventQueue that takes control over the lifetime of Events
that are passed to it. Now I wan't to export this functionality to
python using boost_python.

this is C++:

EventQueue   EQ;

// don't care for the Event -
// the Queue will delete it on time.
EQ->PostEvent( new Event() )



Now, if I export the method 

int EventQueue::PostEvent( Event* i_pEvent )

to python, how do I keep Python from deleting the Event after the
script has finished? Can this be done with call policies ?




More information about the Python-list mailing list