#pragma once #include "util/config/ObjectView.hpp" #include #include #include namespace migration::impl { /** * @brief The migrator specification concept */ template concept MigratorSpec = requires(std::shared_ptr const& backend, util::config::ObjectView const& cfg) { // Check that 'kNAME' exists and is a string { T::kNAME } -> std::convertible_to; // Check that 'kDESCRIPTION' exists and is a string { T::kDESCRIPTION } -> std::convertible_to; // Check that the migrator specifies the backend type it supports typename T::Backend; // Check that 'runMigration' exists and is callable { T::runMigration(backend, cfg) } -> std::same_as; }; /** * @brief used by variadic template to check all migrators are MigratorSpec */ template concept AllMigratorSpec = (MigratorSpec && ...); } // namespace migration::impl