Clio  develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
Spec.hpp
1#pragma once
2
3#include "util/config/ObjectView.hpp"
4
5#include <boost/asio/spawn.hpp>
6
7#include <memory>
8#include <string>
9
10namespace migration::impl {
11
15template <typename T, typename Backend>
16concept MigratorSpec =
17 requires(std::shared_ptr<Backend> const& backend, util::config::ObjectView const& cfg) {
18 // Check that 'kNAME' exists and is a string
19 { T::kNAME } -> std::convertible_to<std::string>;
20
21 // Check that 'kDESCRIPTION' exists and is a string
22 { T::kDESCRIPTION } -> std::convertible_to<std::string>;
23
24 // Check that the migrator specifies the backend type it supports
25 typename T::Backend;
26
27 // Check that 'runMigration' exists and is callable
28 { T::runMigration(backend, cfg) } -> std::same_as<void>;
29 };
30
34template <typename... Types>
36
37} // namespace migration::impl
Provides a view into a subset of configuration data defined by a prefix.
Definition ObjectView.hpp:21
used by variadic template to check all migrators are MigratorSpec
Definition Spec.hpp:35
The migrator specification concept.
Definition Spec.hpp:16