Commit 7685fb63 authored by Dominik Charousset's avatar Dominik Charousset

Add documentation

parent 90e338f3
...@@ -23,7 +23,9 @@ ...@@ -23,7 +23,9 @@
namespace caf { namespace caf {
template <class F> /// Deduces the output type and the state type for a stream source from its
/// `pull` implementation.
template <class Pull>
struct stream_source_trait; struct stream_source_trait;
template <class State, class T> template <class State, class T>
...@@ -32,9 +34,11 @@ struct stream_source_trait<void (State&, downstream<T>&, size_t)> { ...@@ -32,9 +34,11 @@ struct stream_source_trait<void (State&, downstream<T>&, size_t)> {
using state = State; using state = State;
}; };
template <class F> /// Convenience alias for extracting the function signature from `Pull` and
/// passing it to `stream_source_trait`.
template <class Pull>
using stream_source_trait_t = using stream_source_trait_t =
stream_source_trait<typename detail::get_callable_trait<F>::fun_sig>; stream_source_trait<typename detail::get_callable_trait<Pull>::fun_sig>;
} // namespace caf } // namespace caf
......
...@@ -55,6 +55,8 @@ struct stream_stage_trait_invoke_all { ...@@ -55,6 +55,8 @@ struct stream_stage_trait_invoke_all {
template <class F> template <class F>
struct stream_stage_trait; struct stream_stage_trait;
/// Deduces the input type, output type and the state type for a stream stage
/// from its `process` implementation.
template <class State, class In, class Out> template <class State, class In, class Out>
struct stream_stage_trait<void (State&, downstream<Out>&, In)> { struct stream_stage_trait<void (State&, downstream<Out>&, In)> {
using state = State; using state = State;
...@@ -73,9 +75,11 @@ struct stream_stage_trait<void (State&, downstream<Out>&, std::vector<In>&&)> { ...@@ -73,9 +75,11 @@ struct stream_stage_trait<void (State&, downstream<Out>&, std::vector<In>&&)> {
// -- convenience alias -------------------------------------------------------- // -- convenience alias --------------------------------------------------------
template <class F> /// Convenience alias for extracting the function signature from `Process` and
/// passing it to `stream_stage_trait`.
template <class Process>
using stream_stage_trait_t = using stream_stage_trait_t =
stream_stage_trait<typename detail::get_callable_trait<F>::fun_sig>; stream_stage_trait<typename detail::get_callable_trait<Process>::fun_sig>;
} // namespace caf } // namespace caf
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment