17 m.doc() =
"Nanobind bindings for Gibis classes";
18 nb::class_<PClockMockFile>(m,
"PClockMockFile")
24 .def(
"now", &PClockMockFile::now,
25 "Get the mocked current time")
27 .def(
"sleep", [](
const PClockMockFile &c, time_t ellapsedTime) {
28 c.sleep(ellapsedTime);
30 "Sleep for the given elapsed time (no real sleep in mock)")
33 .def(
"setCurrentTime", [](PClockMockFile &c, time_t currentTime) {
34 c.setCurrentTime(currentTime);
36 "Set the mocked current time")
38 .def(
"setMockPrefix", [](PClockMockFile &c,
const std::string &prefix) {
39 c.setMockPrefix(prefix);
41 "Set the mock prefix for logging")
43 .def(
"close", &PClockMockFile::close,
44 "Close the mock file and release resources");
47 m.def(
"phoenix_createMockBackend", [](PClockMockFile &c,
const std::string & prefix) ->
bool {
48 return phoenix_createMockBackend(c, prefix);
50 "Create the mock backend with the given prefix");
52 m.def(
"phoenix_createClockMock", [](
const std::string & prefix,
size_t nbTime, time_t firstTime, time_t timeIncrement) ->
bool {
53 return phoenix_createClockMock(prefix, nbTime, firstTime, timeIncrement);
55 nb::arg(
"prefix"), nb::arg(
"nbTime"), nb::arg(
"firstTime") = 0l, nb::arg(
"timeIncrement") = 1l,
56 "Create a clock mock with the given prefix, number of time points, first time and time increment");
58 m.def(
"phoenix_fillClockMock", [](PClockMockFile &mock,
size_t nbTime, time_t firstTime, time_t timeIncrement) {
59 phoenix_fillClockMock<PClockMockFile>(mock, nbTime, firstTime, timeIncrement);
61 "Fill the given clock mock with time values");