diff options
Diffstat (limited to 'ttwhy/core')
| -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>; |
