Guest User

Untitled

a guest
May 6th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. // Note `XPython` is the name for the Boost Python bindings class of `X`.
  2.  
  3. void BazPython::RunThatFoo(const bp::object & foo) {
  4. FooPython & foo_obj = bp::extract<FooPython&>(foo);
  5. auto ps_ptr = foo_obj.GetPSPtr();
  6. Baz::DoPSComputation(ps_ptr); // Expects a `const std::shared_ptr<planning_scene::PlanningScene>`
  7. }
  8.  
  9. class PlanningScene : private boost::noncopyable, public std::enable_shared_from_this<PlanningScene>
  10.  
  11. std::shared_ptr<planning_scene::PlanningScene> Foo::GetPSPtr() { // two different attempts shown
  12. // return ps_;
  13. return (*ps_).shared_from_this();
  14. }
Add Comment
Please, Sign In to add comment