From a63e7d65293c07e0567cfdafbce693a543bf2a0d Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Tue, 22 Sep 2026 17:01:36 +0200 Subject: lib: rename concept module files --- ttwhy/routers/concepts.cppm | 20 ++++++++++++++++++++ ttwhy/routers/mod.cppm | 2 +- ttwhy/routers/router_concepts.cppm | 20 -------------------- ttwhy/scanners/concepts.cppm | 27 +++++++++++++++++++++++++++ ttwhy/scanners/mod.cppm | 2 +- ttwhy/scanners/terminal_concepts.cppm | 27 --------------------------- ttwhy/scanners/terminal_policies.cppm | 2 +- ttwhy/scanners/terminal_scanner.cppm | 2 +- 8 files changed, 51 insertions(+), 51 deletions(-) create mode 100644 ttwhy/routers/concepts.cppm delete mode 100644 ttwhy/routers/router_concepts.cppm create mode 100644 ttwhy/scanners/concepts.cppm delete mode 100644 ttwhy/scanners/terminal_concepts.cppm (limited to 'ttwhy') diff --git a/ttwhy/routers/concepts.cppm b/ttwhy/routers/concepts.cppm new file mode 100644 index 0000000..9660afc --- /dev/null +++ b/ttwhy/routers/concepts.cppm @@ -0,0 +1,20 @@ +module; + +#include + +#include + +export module ttwhy.routers:concepts; + +import ttwhy.scanners; + +namespace ttwhy +{ + + export template + concept router = requires(Candidate candidate, scanners::input_event event) { + typename Candidate::terminal_policy; + { candidate.process(event) } -> std::same_as>; + }; + +} // namespace ttwhy diff --git a/ttwhy/routers/mod.cppm b/ttwhy/routers/mod.cppm index f5e151b..d1d2d93 100644 --- a/ttwhy/routers/mod.cppm +++ b/ttwhy/routers/mod.cppm @@ -1,4 +1,4 @@ export module ttwhy.routers; export import :echo; -export import :router_concepts; +export import :concepts; diff --git a/ttwhy/routers/router_concepts.cppm b/ttwhy/routers/router_concepts.cppm deleted file mode 100644 index ce143cb..0000000 --- a/ttwhy/routers/router_concepts.cppm +++ /dev/null @@ -1,20 +0,0 @@ -module; - -#include - -#include - -export module ttwhy.routers:router_concepts; - -import ttwhy.scanners; - -namespace ttwhy -{ - - export template - concept router = requires(Candidate candidate, scanners::input_event event) { - typename Candidate::terminal_policy; - { candidate.process(event) } -> std::same_as>; - }; - -} // namespace ttwhy diff --git a/ttwhy/scanners/concepts.cppm b/ttwhy/scanners/concepts.cppm new file mode 100644 index 0000000..69d6459 --- /dev/null +++ b/ttwhy/scanners/concepts.cppm @@ -0,0 +1,27 @@ +module; + +#include +#include + +export module ttwhy.scanners:concepts; + +import :terminal_events; + +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 ansi_sink = requires(Sink sink) { + { sink(std::declval()) } -> std::same_as; + { sink(std::declval()) } -> std::same_as; + { sink(std::declval()) } -> std::same_as; + }; + +} // namespace ttwhy diff --git a/ttwhy/scanners/mod.cppm b/ttwhy/scanners/mod.cppm index a1f45c1..b422a38 100644 --- a/ttwhy/scanners/mod.cppm +++ b/ttwhy/scanners/mod.cppm @@ -1,6 +1,6 @@ export module ttwhy.scanners; -export import :terminal_concepts; +export import :concepts; export import :terminal_events; export import :terminal_policies; export import :terminal_scanner; diff --git a/ttwhy/scanners/terminal_concepts.cppm b/ttwhy/scanners/terminal_concepts.cppm deleted file mode 100644 index e82a8d0..0000000 --- a/ttwhy/scanners/terminal_concepts.cppm +++ /dev/null @@ -1,27 +0,0 @@ -module; - -#include -#include - -export module ttwhy.scanners:terminal_concepts; - -import :terminal_events; - -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 ansi_sink = requires(Sink sink) { - { sink(std::declval()) } -> std::same_as; - { sink(std::declval()) } -> std::same_as; - { sink(std::declval()) } -> std::same_as; - }; - -} // namespace ttwhy diff --git a/ttwhy/scanners/terminal_policies.cppm b/ttwhy/scanners/terminal_policies.cppm index bf7c126..7af0d66 100644 --- a/ttwhy/scanners/terminal_policies.cppm +++ b/ttwhy/scanners/terminal_policies.cppm @@ -5,8 +5,8 @@ module; export module ttwhy.scanners:terminal_policies; +import :concepts; import :terminal_events; -import :terminal_concepts; namespace ttwhy::scanners { diff --git a/ttwhy/scanners/terminal_scanner.cppm b/ttwhy/scanners/terminal_scanner.cppm index 510299c..ec4a1a6 100644 --- a/ttwhy/scanners/terminal_scanner.cppm +++ b/ttwhy/scanners/terminal_scanner.cppm @@ -9,7 +9,7 @@ module; export module ttwhy.scanners:terminal_scanner; -import :terminal_concepts; +import :concepts; import :terminal_events; import :terminal_policies; -- cgit v1.2.3