$extrastylesheet
Olena  User documentation 2.1
An Image Processing Platform
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
neighb_niter_impl.hh
1 // Copyright (C) 2008, 2009, 2012 EPITA Research and Development
2 // Laboratory (LRDE)
3 //
4 // This file is part of Olena.
5 //
6 // Olena is free software: you can redistribute it and/or modify it under
7 // the terms of the GNU General Public License as published by the Free
8 // Software Foundation, version 2 of the License.
9 //
10 // Olena is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with Olena. If not, see <http://www.gnu.org/licenses/>.
17 //
18 // As a special exception, you may use this file as part of a free
19 // software project without restriction. Specifically, if other files
20 // instantiate templates or use macros or inline functions from this
21 // file, or you compile this file and link it with other files to produce
22 // an executable, this file does not by itself cause the resulting
23 // executable to be covered by the GNU General Public License. This
24 // exception does not however invalidate any other reasons why the
25 // executable file might be covered by the GNU General Public License.
26 
27 #ifndef MLN_CORE_INTERNAL_NEIGHB_NITER_IMPL_HH
28 # define MLN_CORE_INTERNAL_NEIGHB_NITER_IMPL_HH
29 
33 
34 # include <mln/core/macros.hh>
35 # include <mln/core/internal/force_exact.hh>
36 
37 
38 namespace mln
39 {
40 
41  // Forward declaration.
42  template <typename P, typename W> class graph_window_base;
43  template <typename G, typename S> class graph_elt_window;
44  template <typename G, typename S, typename S2> class graph_elt_mixed_window;
45  template <typename G, typename F, typename I> class graph_elt_window_if;
46  template <typename G, typename F> class line_graph_elt_window;
47  namespace util
48  {
49  template <typename G> class vertex;
50  template <typename G> class edge;
51  }
52 
53 
54  namespace internal
55  {
56 
61  template <typename W, typename E>
63  {
64 
65  };
66 
82  template <typename P, typename E>
84  {
85  unsigned id() const
86  {
87  return internal::force_exact<E>(*this).compute_p_().id();
88  }
89 
90  };
91 
100  template <typename G, typename E>
101  struct neighb_niter_impl_graph_window< util::vertex<G>, E >
102  {
103  };
104 
113  template <typename G, typename E>
114  struct neighb_niter_impl_graph_window< util::edge<G>, E >
115  {
116  };
117 
118 
124  template <typename P, typename T, typename E>
127  {
128  typedef typename T::target S;
129 
130  // Tech. note: A copy is returned since it actually is a
131  // temporary object; we cannot return a "const&" here for some
132  // compilers badly kills the temporary object...
133  mln_graph_element(S) element() const
134  {
135  return internal::force_exact<E>(*this).compute_p_().element();
136  }
137 
138  };
139 
140 
141 
147  template <typename G, typename S, typename E>
149  : public neighb_niter_impl< graph_window_base< mln_result(S::fun_t),
150  graph_elt_window<G,S> >,
151  E >
152  {
153 
154  };
155 
161  template <typename G, typename F, typename E>
162  struct neighb_niter_impl<line_graph_elt_window<G,F>, E>
163  : public neighb_niter_impl< graph_window_base< mln_result(F),
164  line_graph_elt_window<G, F> >,
165  E >
166  {
167 
168  };
169 
170 
176  template <typename G, typename S, typename I, typename E>
178  : public neighb_niter_impl< graph_window_base< mln_result(S::fun_t),
179  graph_elt_window_if<G,S,I> >,
180  E >
181  {
182 
183  };
184 
185 
191  template <typename G, typename S, typename S2, typename E>
193  : public neighb_niter_impl< graph_window_base< mln_result(S2::fun_t),
194  graph_elt_mixed_window<G,S,S2> >,
195  E >
196  {
197 
198  };
199 
200 
201  } // end of namespace mln::internal
202 
203 } // end of namespace mln
204 
205 #endif // ! MLN_CORE_INTERNAL_NEIGHB_NITER_IMPL_HH