35eb466a60
We've now ported the OpenClCollMeshEngn and PcloudStimProd::produceFrameReq portions of the Livox pipeline to coros.
45 lines
1.1 KiB
C++
45 lines
1.1 KiB
C++
#ifndef ADAPTERS_SMO_ASSEMBLE_FRAME_AREQ_H
|
|
#define ADAPTERS_SMO_ASSEMBLE_FRAME_AREQ_H
|
|
|
|
#include <adapters/smo/cpsCallbackAReq.h>
|
|
#include <spinscale/asynchronousLoop.h>
|
|
#include <spinscale/cps/callback.h>
|
|
#include <ioUringAssemblyEngine.h>
|
|
|
|
namespace smo {
|
|
namespace cpsBoundary {
|
|
|
|
struct AssembleFrameResult
|
|
{
|
|
bool success = false;
|
|
sscl::AsynchronousLoop loop{0};
|
|
};
|
|
|
|
inline CpsCallbackAReq<
|
|
AssembleFrameResult,
|
|
stim_buff::IoUringAssemblyEngine::assembleFrameReqCbFn,
|
|
std::function<void(sscl::cps::Callback<
|
|
stim_buff::IoUringAssemblyEngine::assembleFrameReqCbFn>)>>
|
|
getAssembleFrameReqAReqAwaiter(
|
|
boost::asio::io_context &resumeIoContext,
|
|
stim_buff::IoUringAssemblyEngine &engine)
|
|
{
|
|
return CpsCallbackAReq<
|
|
AssembleFrameResult,
|
|
stim_buff::IoUringAssemblyEngine::assembleFrameReqCbFn,
|
|
std::function<void(sscl::cps::Callback<
|
|
stim_buff::IoUringAssemblyEngine::assembleFrameReqCbFn>)>>(
|
|
resumeIoContext,
|
|
[&engine](
|
|
sscl::cps::Callback<
|
|
stim_buff::IoUringAssemblyEngine::assembleFrameReqCbFn> cb)
|
|
{
|
|
engine.assembleFrameReq(std::move(cb));
|
|
});
|
|
}
|
|
|
|
} // namespace cpsBoundary
|
|
} // namespace smo
|
|
|
|
#endif // ADAPTERS_SMO_ASSEMBLE_FRAME_AREQ_H
|