libcaf  0.16.0
Related Functions | List of all members
caf::composed_type< Xs, Ys, Zs, Rs > Struct Template Reference

Computes the type for f*g (actor composition). More...

#include <composed_type.hpp>

Related Functions

(Note that these are not member functions.)

template<class F , class G >
using composed_type_t = typename composed_type< G, F, F, detail::type_list<> >::type
 Convenience type alias.
 

Detailed Description

template<class Xs, class Ys, class Zs, class Rs>
struct caf::composed_type< Xs, Ys, Zs, Rs >

Computes the type for f*g (actor composition).

let output_type x = case x of Stream y -> y ; Single y -> y
let propagate_stream from to = case from of
Stream _ -> Stream (output_type to)
Single _ -> to
let composed_type f g =
[(fst x, propagate_stream (snd x) (snd y)) | x <- g, y <- f,
output_type (snd x) == fst y]

This class implements the list comprehension above in a single shot with worst case n*m template instantiations using an inner and outer loop, where n is the size of Xs and m the size of Ys. Zs is a helper that models the "inner loop variable" for generating the cross product of Xs and Ys. The helper function propagate_stream is integrated into the loop with four cases for the matching case. Rs collects the results.


The documentation for this struct was generated from the following file: