Guest User

Untitled

a guest
Jul 6th, 2012
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. #include <boost/python.hpp>
  2.  
  3. class Owner
  4. {
  5.     public:
  6.         Owner();
  7.         ~Owner();
  8. }
  9.  
  10. class Data
  11. {
  12.     private:
  13.        Owner *m_owner;
  14.     public:
  15.         Data(Owner *owner) {
  16.             // Transfer ownership
  17.         m_owner = owner
  18.     }
  19.         ~Data() {
  20.         if (!m_owner->m_calling_destructors) { err_printf("ERROR: Shouldn't be called directly"}
  21.     }
  22. }
  23.  
  24.  
  25. BOOST_PYTHON_MODULE(datatest)
  26. {
  27.     using namespace boost::python;
  28.  
  29.     class_<Owner>("Owner", init<>());
  30.  
  31.     class_<Data, init<Router *>()>;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment