diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2026-09-24 07:59:43 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2026-09-24 07:59:43 +0200 |
| commit | 79a35574ce6d472f7a7cc4a200a1ed7befe34066 (patch) | |
| tree | 1fb3c1c33645692bc041af8d285bb99754887149 /ttwhy/core/concepts.cppm | |
| parent | d05b9343f69a0841043963088e0003368e205bd9 (diff) | |
| download | ttwhy-79a35574ce6d472f7a7cc4a200a1ed7befe34066.tar.xz ttwhy-79a35574ce6d472f7a7cc4a200a1ed7befe34066.zip | |
doc: add API documentation
Diffstat (limited to 'ttwhy/core/concepts.cppm')
| -rw-r--r-- | ttwhy/core/concepts.cppm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ttwhy/core/concepts.cppm b/ttwhy/core/concepts.cppm index f7ac583..eea97e2 100644 --- a/ttwhy/core/concepts.cppm +++ b/ttwhy/core/concepts.cppm @@ -10,6 +10,9 @@ export module ttwhy.core:concepts; namespace ttwhy { + //! Validates that a candidate type implements the byte scanner interface. + //! + //! @tparam Candidate The type to validate. export template<typename Candidate> concept scanner = requires(Candidate a, std::span<char const> buffer) { { a.process(buffer) } -> std::same_as<void>; @@ -17,11 +20,19 @@ namespace ttwhy { a.is_pending() } -> std::same_as<bool>; }; + //! Validates that a candidate type implements an asynchronous event router interface. + //! + //! @tparam Candidate The type to validate. + //! @tparam Event The type of the event to process. export template<typename Candidate, typename Event> concept router = requires(Candidate candidate, Event event) { { candidate.process(event) } -> std::same_as<asio::awaitable<void>>; }; + //! Validates that a sink type can receive an event of the given type. + //! + //! @tparam Sink The sink callable type. + //! @tparam Event The type of the event to deliver. export template<typename Sink, typename Event> concept event_sink = requires(Sink sink, Event event) { { sink(event) } -> std::same_as<void>; |
