#ifndef FESA_ASSEMBLY_PARALLEL_FOR_H_ #define FESA_ASSEMBLY_PARALLEL_FOR_H_ #include #include namespace fesa { /// @brief Executes independent index-addressed work behind a backend boundary. /// @note Callers own output storage and each invocation may write only its /// index-owned slot. class ParallelFor { public: virtual ~ParallelFor() = default; /// @brief Invokes body once for every index in [0, count). virtual void Execute(std::size_t count, const std::function& body) const = 0; }; /// @brief Executes index-addressed work serially. class SerialParallelFor final : public ParallelFor { public: /// @copydoc ParallelFor::Execute void Execute(std::size_t count, const std::function& body) const override; }; /// @brief Executes index-addressed work through oneTBB. class TbbParallelFor final : public ParallelFor { public: /// @copydoc ParallelFor::Execute void Execute(std::size_t count, const std::function& body) const override; }; } // namespace fesa #endif // FESA_ASSEMBLY_PARALLEL_FOR_H_