Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <boost/python.hpp>
- class Owner
- {
- public:
- Owner();
- ~Owner();
- }
- class Data
- {
- private:
- Owner *m_owner;
- public:
- Data(Owner *owner) {
- // Transfer ownership
- m_owner = owner
- }
- ~Data() {
- if (!m_owner->m_calling_destructors) { err_printf("ERROR: Shouldn't be called directly"}
- }
- }
- BOOST_PYTHON_MODULE(datatest)
- {
- using namespace boost::python;
- class_<Owner>("Owner", init<>());
- class_<Data, init<Router *>()>;
- }
Advertisement
Add Comment
Please, Sign In to add comment