Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • N ndcurves
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 11
    • Issues 11
    • List
    • Boards
    • Service Desk
    • Milestones
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • loco-3d
  • ndcurves
  • Issues
  • #32
Closed
Open
Issue created Jan 23, 2020 by Pierre Fernbach@pfernbacOwner

Issue in binding of Piecewise.curve_at_index

See https://gepgitlab.laas.fr/pfernbac/curves/-/jobs/60305 with new python test-case highlighting the issue. (line https://gepgitlab.laas.fr/pfernbac/curves/blob/9c579a27de430d77541a2d9d0d994cfc63e5c4fc/python/test/test.py#L422 fail).

In the current implementation, piecewise::curve_at_index return a shared_pointer<curve_abc>, then it can be binded directly with boost::python because the shared_pointers for each python class are defined. This implementation work only if the curve returned by piecewise::curve_at_index have been created in python before the call of the method, as it was the case in all the previous unit-test (eg in https://gepgitlab.laas.fr/pfernbac/curves/blob/9c579a27de430d77541a2d9d0d994cfc63e5c4fc/python/test/test.py#L367).

In the case where the curve have been created in C++, when the shared_pointer is returned and wrapped by boost::python, it is wrapped in the parent abstract class (curve_abc) instead of the real class. Which lead to the error in the failed job linked above.

This issue may be solved by returning a raw pointer in C++ instead of a shared pointer and then bind the method with boost::python::return_internal_reference. But I did not test this deeply and I do not know if it's the best way to solve this.

Edited Jan 24, 2020 by Pierre Fernbach
Assignee
Assign to
Time tracking