00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef MLN_CORE_INTERNAL_NEIGHB_NITER_IMPL_HH
00028 # define MLN_CORE_INTERNAL_NEIGHB_NITER_IMPL_HH
00029
00033
00034 # include <mln/core/macros.hh>
00035 # include <mln/core/internal/force_exact.hh>
00036
00037
00038 namespace mln
00039 {
00040
00041
00042 template <typename P, typename W> class graph_window_base;
00043 template <typename G, typename S> class graph_elt_window;
00044 template <typename G, typename S, typename S2> class graph_elt_mixed_window;
00045 template <typename G, typename F, typename I> class graph_elt_window_if;
00046 template <typename G, typename F> class line_graph_elt_window;
00047 namespace util
00048 {
00049 template <typename G> class vertex;
00050 template <typename G> class edge;
00051 }
00052
00053
00054 namespace internal
00055 {
00056
00058 template <typename W, typename E>
00059 struct neighb_niter_impl
00060 {
00061
00062 };
00063
00076 template <typename P, typename E>
00077 struct neighb_niter_impl_graph_window
00078 {
00079 unsigned id() const
00080 {
00081 return internal::force_exact<E>(*this).compute_p_().id();
00082 }
00083
00084 };
00085
00091 template <typename G, typename E>
00092 struct neighb_niter_impl_graph_window< util::vertex<G>, E >
00093 {
00094 };
00095
00101 template <typename G, typename E>
00102 struct neighb_niter_impl_graph_window< util::edge<G>, E >
00103 {
00104 };
00105
00106
00109 template <typename P, typename T, typename E>
00110 struct neighb_niter_impl< graph_window_base<P, T>, E >
00111 : neighb_niter_impl_graph_window<P,E>
00112 {
00113 typedef typename T::target S;
00114
00115
00116
00117
00118 mln_graph_element(S) element() const
00119 {
00120 return internal::force_exact<E>(*this).compute_p_().element();
00121 }
00122
00123 };
00124
00125
00126
00129 template <typename G, typename S, typename E>
00130 struct neighb_niter_impl<graph_elt_window<G,S>, E>
00131 : public neighb_niter_impl< graph_window_base< mln_result(S::fun_t),
00132 graph_elt_window<G,S> >,
00133 E >
00134 {
00135
00136 };
00137
00140 template <typename G, typename F, typename E>
00141 struct neighb_niter_impl<line_graph_elt_window<G,F>, E>
00142 : public neighb_niter_impl< graph_window_base< mln_result(F),
00143 line_graph_elt_window<G, F> >,
00144 E >
00145 {
00146
00147 };
00148
00149
00152 template <typename G, typename S, typename I, typename E>
00153 struct neighb_niter_impl<graph_elt_window_if<G,S,I>, E>
00154 : public neighb_niter_impl< graph_window_base< mln_result(S::fun_t),
00155 graph_elt_window_if<G,S,I> >,
00156 E >
00157 {
00158
00159 };
00160
00161
00164 template <typename G, typename S, typename S2, typename E>
00165 struct neighb_niter_impl<graph_elt_mixed_window<G,S,S2>, E>
00166 : public neighb_niter_impl< graph_window_base< mln_result(S2::fun_t),
00167 graph_elt_mixed_window<G,S,S2> >,
00168 E >
00169 {
00170
00171 };
00172
00173
00174 }
00175
00176 }
00177
00178 #endif // ! MLN_CORE_INTERNAL_NEIGHB_NITER_IMPL_HH