aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/types/time_spec_python.hpp
blob: f411af0b0c0e1ea4e9c0e92be9058d9436ba079e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//
// Copyright 2017-2018 Ettus Research, a National Instruments Company
//
// SPDX-License-Identifier: GPL-3.0-or-later
//

#ifndef INCLUDED_UHD_TIME_SPEC_PYTHON_HPP
#define INCLUDED_UHD_TIME_SPEC_PYTHON_HPP

#include <uhd/types/time_spec.hpp>

void export_time_spec()
{
    using time_spec_t = uhd::time_spec_t;

    bp::class_<time_spec_t>("time_spec", bp::init<double>())

        // Methods
        .def("from_ticks"     , &time_spec_t::from_ticks     )
        .staticmethod("from_ticks"                           )

        .def("get_tick_count" , &time_spec_t::get_tick_count )
        .def("to_ticks"       , &time_spec_t::to_ticks       )
        .def("get_real_secs"  , &time_spec_t::get_real_secs  )
        .def("get_frac_secs"  , &time_spec_t::get_frac_secs  )

        .def(bp::self += time_spec_t())
        .def(bp::self += double())
        .def(bp::self + double())
        .def(bp::self + time_spec_t())
        .def(bp::self -= time_spec_t())
        ;
}

#endif /* INCLUDED_UHD_TIME_SPEC_PYTHON_HPP */