PyPhoenixClockBackend  1.1.0
Binding for PhoenixClock library
Loading...
Searching...
No Matches
clock_backend_binding.h File Reference
#include "PClockBackend.h"
#include <time.h>
#include <nanobind/nanobind.h>
#include <nanobind/stl/string.h>
#include <nanobind/stl/chrono.h>
+ Include dependency graph for clock_backend_binding.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void make_clock_backend_binding (nb::module_ &m)
 

Function Documentation

◆ make_clock_backend_binding()

void make_clock_backend_binding ( nb::module_ & m)
inline

Definition at line 18 of file clock_backend_binding.h.

18 {
19 nb::module_ m_clock_backend = m.def_submodule("clock_backend", "Clock backend utilities");
20
21 nb::class_<PClockBackend>(m_clock_backend, "PClockBackend")
22
23 // Constructor
24 .def(nb::init<>())
25
26 // Static methods only since PClockBackend is a struct with static methods
27 .def_static("now", &PClockBackend::now,
28 "Get current time with PClockBackend")
29
30 .def_static("sleep", [](time_t ellapsedTime) {
31 PClockBackend::sleep(ellapsedTime);
32 },
33 nb::arg("ellapsedTime"),
34 "Sleep for the given elapsed time"
35 );
36}

Referenced by NB_MODULE().

+ Here is the caller graph for this function: