OClCollMeshEngn,PcloudStimProd: port to sscl::co coros
We've now ported the OpenClCollMeshEngn and PcloudStimProd::produceFrameReq portions of the Livox pipeline to coros.
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user