Clio
develop
The XRP Ledger API server.
Theme:
Default
Round
Robot
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
10
namespace
migration::impl {
11
15
template
<
typename
T,
typename
Backend>
16
concept
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
34
template
<
typename
... Types>
35
concept
AllMigratorSpec
= (
MigratorSpec<Types, typename Types::Backend>
&& ...);
36
37
}
// namespace migration::impl
util::config::ObjectView
Provides a view into a subset of configuration data defined by a prefix.
Definition
ObjectView.hpp:21
migration::impl::AllMigratorSpec
used by variadic template to check all migrators are MigratorSpec
Definition
Spec.hpp:35
migration::impl::MigratorSpec
The migrator specification concept.
Definition
Spec.hpp:16
src
migration
impl
Spec.hpp
Generated by
1.16.1