Directory: | ./ |
---|---|
File: | src/dynamic-python-module-py.cc |
Date: | 2024-11-28 11:10:33 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 14 | 16 | 87.5% |
Branches: | 13 | 26 | 50.0% |
Line | Branch | Exec | Source |
---|---|---|---|
1 | #include <sot/dynamic-pinocchio/dynamic-pinocchio.h> | ||
2 | |||
3 | #include <dynamic-graph/python/module.hh> | ||
4 | |||
5 | namespace dg = dynamicgraph; | ||
6 | namespace dgs = dynamicgraph::sot; | ||
7 | |||
8 | typedef bp::return_value_policy<bp::reference_existing_object> | ||
9 | reference_existing_object; | ||
10 | |||
11 |
2/4✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
|
4 | BOOST_PYTHON_MODULE(wrap) { |
12 |
1/2✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
|
2 | bp::import("dynamic_graph"); |
13 |
1/2✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
|
2 | bp::import("pinocchio"); |
14 | |||
15 | dg::python::exposeEntity<dgs::DynamicPinocchio, bp::bases<dg::Entity>, | ||
16 | 2 | dg::python::AddCommands>() | |
17 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | .add_property("model", |
18 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | bp::make_function(&dgs::DynamicPinocchio::getModel, |
19 | ✗ | reference_existing_object()), | |
20 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
4 | bp::make_function(&dgs::DynamicPinocchio::setModel)) |
21 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | .add_property("data", |
22 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
4 | bp::make_function(&dgs::DynamicPinocchio::getData, |
23 | ✗ | reference_existing_object()), | |
24 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
4 | bp::make_function(&dgs::DynamicPinocchio::setData)) |
25 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | .def("setModel", &dgs::DynamicPinocchio::setModel) |
26 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | .def("createData", &dgs::DynamicPinocchio::createData) |
27 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | .def("setData", &dgs::DynamicPinocchio::setData); |
28 | 2 | } | |
29 |