8 #ifndef OCM_DAQ_OP_AWAIT_HPP_
9 #define OCM_DAQ_OP_AWAIT_HPP_
10 #include "../config.hpp"
14 #include <boost/thread/future.hpp>
15 #include <boost/asio/steady_timer.hpp>
17 #include "../dpPart.hpp"
18 #include "../error.hpp"
71 [[nodiscard]] boost::future<Result<DpParts>>
Initiate();
76 void Abort() noexcept;
94 boost::future<bool> AwaitOnceAsync();
105 boost::future<std::shared_ptr<recif::RecWaitStatus>>&& fut);
110 boost::future<void> MakeInterval();
113 struct IntervalTimer {
114 IntervalTimer(boost::asio::io_context& io_ctx, std::chrono::steady_clock::time_point next)
115 : timer(io_ctx, next), promise() {
120 boost::asio::steady_timer timer;
121 boost::promise<void> promise;
143 boost::promise<Result<DpParts>> m_promise;
147 std::optional<IntervalTimer> m_interval;
148 std::optional<std::chrono::steady_clock::time_point> m_last_start;
152 #endif // #ifndef OCM_DAQ_OP_AWAIT_HPP_