Milena (Olena)  User documentation 2.0a Id
 All Classes Namespaces Functions Variables Typedefs Enumerator Groups Pages
adj_lower_face_iter.hh
1 // Copyright (C) 2008, 2009, 2010 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_TOPO_ADJ_LOWER_FACE_ITER_HH
28 # define MLN_TOPO_ADJ_LOWER_FACE_ITER_HH
29 
34 
35 # include <mln/topo/internal/complex_relative_iterator_base.hh>
36 # include <mln/topo/algebraic_face.hh>
37 
38 
39 namespace mln
40 {
41 
42  namespace topo
43  {
44 
45  // Forward declarations.
46  template <unsigned D> class complex;
47 
48  namespace internal
49  {
50 
51  template <typename C, typename F, typename E>
52  class forward_complex_relative_iterator_base;
53 
54  template <typename C, typename F, typename E>
55  class backward_complex_relative_iterator_base;
56 
57  } // end of namespace mln::topo::internal
58 
59  template <unsigned D>
60  class algebraic_face;
61 
62 
63  /*-----------------------------------.
64  | topo::adj_lower_face_fwd_iter<D>. |
65  `-----------------------------------*/
66 
71  //
72  template <unsigned D>
74  : public internal::forward_complex_relative_iterator_base< topo::face<D>,
75  algebraic_face<D>,
76  adj_lower_face_fwd_iter<D> >
77  {
78  // Tech note: we use topo::face to help g++-2.95.
79  private:
81  typedef internal::forward_complex_relative_iterator_base< topo::face<D>,
83  self_ > super_;
84 
85  public:
89  template <typename Fref>
90  adj_lower_face_fwd_iter(const Fref& f_ref);
92 
94  void update_adj_faces_();
95  };
96 
97 
98  /*-----------------------------------.
99  | topo::adj_lower_face_bkd_iter<D>. |
100  `-----------------------------------*/
101 
106  //
107  template <unsigned D>
109  : public internal::backward_complex_relative_iterator_base< topo::face<D>,
110  algebraic_face<D>,
111  adj_lower_face_bkd_iter<D> >
112  {
113  // Tech note: we use topo::face to help g++-2.95.
114  private:
116  typedef internal::backward_complex_relative_iterator_base< topo::face<D>,
118  self_ > super_;
119  public:
123  template <typename Fref>
124  adj_lower_face_bkd_iter(const Fref& f_ref);
126 
128  void update_adj_faces_();
129  };
130 
131 
132 
133 # ifndef MLN_INCLUDE_ONLY
134 
135  /*-----------------------------------.
136  | topo::adj_lower_face_fwd_iter<D>. |
137  `-----------------------------------*/
138 
139  template <unsigned D>
140  inline
142  {
143  }
144 
145  template <unsigned D>
146  template <typename Fref>
147  inline
149  : super_(f_ref)
150  {
151  }
152 
153  template <unsigned D>
154  inline
155  void
156  adj_lower_face_fwd_iter<D>::update_adj_faces_()
157  {
158  mln_precondition(this->c_);
159  this->adj_faces_ = this->c_->lower_dim_adj_faces();
160  }
161 
162 
163  /*-----------------------------------.
164  | topo::adj_lower_face_bkd_iter<D>. |
165  `-----------------------------------*/
166 
167  template <unsigned D>
168  inline
170  {
171  }
172 
173  template <unsigned D>
174  template <typename Fref>
175  inline
177  : super_(f_ref)
178  {
179  }
180 
181  template <unsigned D>
182  inline
183  void
184  adj_lower_face_bkd_iter<D>::update_adj_faces_()
185  {
186  mln_precondition(this->c_);
187  this->adj_faces_ = this->c_->lower_dim_adj_faces();
188  }
189 
190 # endif // ! MLN_INCLUDE_ONLY
191 
192  } // end of namespace mln::topo
193 
194 } // end of namespace mln
195 
196 #endif // ! MLN_TOPO_ADJ_LOWER_FACE_ITER_HH