SRS-control
0.1.4
Loading...
Searching...
No Matches
CommonConcepts.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include "
srs/utils/CommonAlias.hpp
"
// IWYU pragma: keep
4
#include <boost/asio/any_io_executor.hpp>
5
#include <concepts>
6
#include <fstream>
7
#include <iterator>
8
#include <type_traits>
9
#include <utility>
10
11
namespace
srs
12
{
13
template
<
typename
T>
14
concept
Deserializer
=
requires
(T) {
15
typename
T::OutputType;
16
typename
T::InputType;
17
};
18
19
template
<
typename
T>
20
concept
StreamableOutput
=
requires
(T obj) { std::declval<std::ofstream>() << obj; };
21
22
template
<
typename
T>
23
concept
StreamableDeserializer
=
Deserializer<T>
and
StreamableOutput<typename T::OutputType>
;
24
25
template
<
typename
T>
26
concept
RangedData
=
requires
(T obj) {
27
requires
std::contiguous_iterator<
decltype
(obj.begin())>;
28
requires
std::contiguous_iterator<
decltype
(obj.end())>;
29
};
30
31
template
<
typename
DataType,
typename
TaskType>
32
concept
OutputCompatible
=
requires
(DataType, TaskType task) {
33
std::is_same_v<DataType, std::remove_cvref_t<
decltype
(task.get_output_data())>>;
34
};
35
36
template
<
typename
Converter,
typename
OutputType>
37
concept
OutputTo
=
requires
(Converter converter) {
38
std::is_const_v<OutputType>;
39
std::is_reference_v<OutputType>;
40
{ converter(0) } -> std::same_as<OutputType>;
41
};
42
};
// namespace srs
CommonAlias.hpp
srs::Deserializer
Definition
CommonConcepts.hpp:14
srs::OutputCompatible
Definition
CommonConcepts.hpp:32
srs::OutputTo
Definition
CommonConcepts.hpp:37
srs::RangedData
Definition
CommonConcepts.hpp:26
srs::StreamableDeserializer
Definition
CommonConcepts.hpp:23
srs::StreamableOutput
Definition
CommonConcepts.hpp:20
srs
Definition
Application.cpp:29
backend
srs
utils
CommonConcepts.hpp
Impressum
Datenschutzerklärung
Generated by
1.15.0