From d05b9343f69a0841043963088e0003368e205bd9 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Tue, 22 Sep 2026 22:47:33 +0200 Subject: lib: restructure into vertical slices --- ttwhy/core/concepts.cppm | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 ttwhy/core/concepts.cppm (limited to 'ttwhy/core/concepts.cppm') diff --git a/ttwhy/core/concepts.cppm b/ttwhy/core/concepts.cppm new file mode 100644 index 0000000..f7ac583 --- /dev/null +++ b/ttwhy/core/concepts.cppm @@ -0,0 +1,30 @@ +module; + +#include + +#include +#include + +export module ttwhy.core:concepts; + +namespace ttwhy +{ + + export template + concept scanner = requires(Candidate a, std::span buffer) { + { a.process(buffer) } -> std::same_as; + { a.timeout() } -> std::same_as; + { a.is_pending() } -> std::same_as; + }; + + export template + concept router = requires(Candidate candidate, Event event) { + { candidate.process(event) } -> std::same_as>; + }; + + export template + concept event_sink = requires(Sink sink, Event event) { + { sink(event) } -> std::same_as; + }; + +} // namespace ttwhy -- cgit v1.2.3