/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ #pragma once #include namespace OpenVulkano { class Task { public: virtual ~Task() = default; virtual void Execute() {} }; class FunctionalTask final : public Task { std::function function; public: FunctionalTask(const std::function& function) : function(function) {} FunctionalTask(std::function&& function) : function(std::move(function)) {} ~FunctionalTask() override = default; void Execute() override { function(); } }; }