#pragma once

#include "../../../include/dv-processing/core/stereo_event_stream_slicer.hpp"

#include <pybind11/pybind11.h>

namespace py = pybind11;

/**
 * @brief Bind StereoEventStreamSlicer class to python
 * @param m pybind The module to bind to
 */
void bind_stereo_event_stream_slicer(py::module &m) {
	using pybind11::operator""_a;

	py::class_<dv::StereoEventStreamSlicer>(m, "StereoEventStreamSlicer")
		.def(py::init())
		.def("accept", &dv::StereoEventStreamSlicer::accept, "leftEvents"_a, "rightEvents"_a,
			"Adds EventStores from the left and right camera. Performs job evaluation immediately.")
		.def("doEveryTimeInterval", &dv::StereoEventStreamSlicer::doEveryTimeInterval, "interval"_a, "callback"_a,
			"Perform an action on the stereo stream data every given time interval. Event period is evaluated on the "
			"left camera stream and according time interval of data is sliced from the right camera event stream. "
			"Sliced data is passed into the callback function as soon as it arrived, first argument is left camera "
			"events and second is right camera events.")
		.def("doEveryNumberOfEvents", &dv::StereoEventStreamSlicer::doEveryNumberOfEvents, "n"_a, "callback"_a,
			"Perform an action on the stereo stream data every given amount of events. Event count is evaluated on the "
			"left camera stream and according time interval of data is sliced from the right camera event stream. "
			"Sliced data is passed into the callback function as soon as it arrived, first argument is left camera "
			"events and second is right camera events. Since right camera events are sliced by the time interval of "
			"left camera, the amount of events on right camera can be different.")
		.def("hasJob", &dv::StereoEventStreamSlicer::hasJob, "jobId"_a,
			"Returns true if the slicer contains the slicejob with the provided id")
		.def("removeJob", &dv::StereoEventStreamSlicer::removeJob, "jobId"_a,
			"Removes the given job from the list of current jobs.");
}
