#ifndef ALSK_ALSK_IMPL_BONE_LOOP_H #define ALSK_ALSK_IMPL_BONE_LOOP_H #include #include "../boneimplbase.h" #include "../../skeleton/bone/loop.h" namespace alsk { /** * @brief Loop implementation for any execution */ template struct Impl, Tag, Executor, State>: BoneImplBase, Tag, Executor, State> { using This = Impl; using ETask = Execute; typename This::Skeleton skeleton; typename This::Executor executor; typename This::StateRef state; constexpr Impl() = default; template constexpr Impl(S&& skeleton, O&& executor, State& state): skeleton{std::forward(skeleton)}, executor{std::forward(executor)}, state{state} {} constexpr typename This::Return operator()(Args... args) { for(unsigned int i = 0; i < skeleton.n; ++i) executor.template execute(*this, skeleton.task, std::forward_as_tuple(args...), std::tuple<>{}); } }; } #endif