16 {
17 m.doc() = "Nanobind bindings for ClockMock class";
18 nb::class_<PClockMock>(m, "PClockMock")
19
20
21 .def(nb::init<>())
22
23
24 .def("now", &PClockMock::now,
25 "Get the mocked current time")
26
27 .def("sleep", [](const PClockMock &c, time_t ellapsedTime) {
28 c.sleep(ellapsedTime);
29 },
30 "Sleep for the given elapsed time (no real sleep in mock)")
31
32
33 .def("setCurrentTime", [](PClockMock &c, time_t currentTime) {
34 c.setCurrentTime(currentTime);
35 },
36 "Set the mocked current time")
37
38 .def("setMockPrefix", [](PClockMock &c, const std::string &prefix) {
39 c.setMockPrefix(prefix);
40 },
41 "Set the mock prefix for logging")
42
43 .def("resetIndex", &PClockMock::resetIndex,
44 "Reset the mock index to start from the beginning of the mock data")
45
46 .def("close", &PClockMock::close,
47 "Close the mock and release resources");
48
49
50 m.def("phoenix_createMockBackend", [](PClockMock &c, const std::string & prefix) -> bool {
51 return phoenix_createMockBackend(c, prefix);
52 },
53 nb::arg("c"), nb::arg("prefix") = "",
54 "Create the mock backend with the given prefix");
55}