GCC Code Coverage Report


Directory: ./
File: src/tools/switch-python-module-py.cc
Date: 2024-11-13 12:35:17
Exec Total Coverage
Lines: 0 15 0.0%
Branches: 0 22 0.0%

Line Branch Exec Source
1 #include <sot/core/switch.hh>
2
3 #include "dynamic-graph/python/module.hh"
4
5 namespace dg = dynamicgraph;
6 typedef bp::return_value_policy<bp::reference_existing_object>
7 reference_existing_object;
8
9 template <typename T, typename Time>
10 void exposeSwitch() {
11 typedef dg::sot::Switch<T, Time> E_t;
12 typedef typename E_t::Base B_t;
13 dg::python::exposeEntity<E_t, bp::bases<dg::Entity>,
14 dg::python::AddCommands>()
15 .def_readonly("sout", &E_t::SOUT)
16 .def("sin", &B_t::getSignalIn, reference_existing_object())
17 .add_property("n_sin", &B_t::getSignalNumber, &B_t::setSignalNumber,
18 "the number of input signal.")
19 .def_readonly("selection", &E_t::selectionSIN)
20 .def_readonly("boolSelection", &E_t::boolSelectionSIN)
21
22 .def("setSignalNumber", &B_t::setSignalNumber,
23 "set the number of input signal.", bp::arg("size"))
24 .def("getSignalNumber", &B_t::getSignalNumber,
25 "get the number of input signal.", bp::arg("size"));
26 }
27
28 BOOST_PYTHON_MODULE(wrap) {
29 exposeSwitch<bool, int>();
30 exposeSwitch<dg::Vector, int>();
31 exposeSwitch<dg::sot::MatrixHomogeneous, int>();
32 }
33