27 #ifndef MLN_TRAIT_CH_VALUE_HH
28 # define MLN_TRAIT_CH_VALUE_HH
34 # include <mln/tag/skeleton.hh>
35 # include <mln/trait/image_from_grid.hh>
36 # include <mln/trait/ch_function_value.hh>
43 # define mln_ch_value(I, V) typename mln::trait::ch_value< I, V >::ret
49 # define mln_ch_value_(I, V) mln::trait::ch_value< I, V >::ret
57 namespace algebra {
template <
unsigned n,
typename T>
class vec; }
58 template <
typename G,
typename F>
class p_edges;
59 template <
typename G,
typename F>
class p_vertices;
60 template <
typename P,
typename V,
typename G>
class vertex_image;
61 template <
typename P,
typename V,
typename G>
class edge_image;
63 namespace pw {
template <
typename F,
typename S>
class image; }
71 template <
typename I,
typename V>
struct ch_value;
78 template <
typename I,
typename V>
struct ch_value_;
80 template <
typename I,
typename V>
81 struct ch_value_< tag::
image_<I>, V >
83 typedef mln_ch_value(I, V)
ret;
86 template <
template <
class>
class M,
typename T,
88 struct ch_value_< M< tag::value_<T> >, V >
93 template <
template <
class>
class M,
typename I,
95 struct ch_value_< M< tag::
image_<I> >, V >
97 typedef M< mln_ch_value(I, V) >
ret;
100 template <
template <
class,
class>
class M,
typename T,
typename I,
102 struct ch_value_< M< tag::value_<T>, tag::image_<I> >, V >
104 typedef mln_ch_value(I, V)
ret;
107 template <
template <
class,
class>
class M,
typename P,
typename T,
109 struct ch_value_< M< tag::psite_<P>, tag::value_<T> >, V >
111 typedef M< P, V >
ret;
114 template <
template <
class,
class>
class M,
typename I1,
typename I2,
116 struct ch_value_< M< tag::
image_<I1>, tag::image_<I2> >, V >
118 typedef M< mln_ch_value(I1, V), mln_ch_value(I2, V) >
ret;
121 template <
template <
class,
class>
class M,
typename I,
typename E,
123 struct ch_value_< M< tag::
image_<I>, tag::ext_<E> >, V >
125 typedef M< mln_ch_value(I, V), E >
ret;
129 template <
template <
unsigned,
class,
class>
class M,
130 unsigned D,
typename G,
typename T,
typename V >
131 struct ch_value_< M< D, tag::psite_<G>, tag::value_<T> >, V >
133 typedef M< D, G, V >
ret;
137 template <
template <
class,
class>
class M,
typename I,
typename N,
139 struct ch_value_< M< tag::
image_<I>, tag::neighb_<N> >, V >
141 typedef M < mln_ch_value(I, V), N >
ret;
144 template <
template <
class,
class>
class M,
typename I,
typename S,
146 struct ch_value_< M< tag::
image_<I>, tag::domain_<S> >, V >
148 typedef M< mln_ch_value(I, V), S >
ret;
151 template <
template <
class,
class>
class M,
typename F,
typename S,
153 struct ch_value_< M< tag::function_<F>, tag::domain_<S> >, V >
156 typedef mln_deduce(S,
site, grid) grid;
157 typedef typename image_from_grid< grid, V >::ret
ret;
162 template <
typename F,
163 typename G,
typename FP,
165 struct ch_value_< pw::image< tag::function_<F>, tag::domain_<p_edges<G, FP> > >, V >
171 template <
typename F,
172 typename G,
typename FP,
174 struct ch_value_< pw::image< tag::function_<F>, tag::domain_<p_vertices<G, FP> > >, V >
181 template <
typename P,
typename V1,
typename G,
typename V2>
182 struct ch_value_< vertex_image< tag::psite_<P>,
191 template <
typename P,
typename V1,
typename G,
typename V2>
192 struct ch_value_< edge_image< tag::psite_<P>,
201 template <
typename I,
typename V>
202 struct ch_value_< labeled_image< tag::
image_<I> >,
205 typedef mln_ch_value(I,V)
ret;
209 template <
template <
class,
class>
class M,
typename T,
typename S,
211 struct ch_value_< M< tag::value_<T>, tag::domain_<S> >, V >
214 typedef mln_deduce(S,
site, grid) grid;
215 typedef typename image_from_grid< grid, V >::ret
ret;
219 template <
template <
class,
class>
class M,
typename I,
typename F,
221 struct ch_value_< M< tag::
image_<I>, tag::function_<F> >, V >
223 typedef M< mln_ch_value(I, V), F >
ret;
284 template <
typename I,
typename V>
288 typedef typename impl::ch_value_<skeleton, V>::ret
ret;
296 #endif // ! MLN_TRAIT_CH_VALUE_HH