• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Classes
  • Files
  • File List

centered_iter_adapter.hh

00001 // Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
00002 //
00003 // This file is part of Olena.
00004 //
00005 // Olena is free software: you can redistribute it and/or modify it under
00006 // the terms of the GNU General Public License as published by the Free
00007 // Software Foundation, version 2 of the License.
00008 //
00009 // Olena is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU General Public License
00015 // along with Olena.  If not, see <http://www.gnu.org/licenses/>.
00016 //
00017 // As a special exception, you may use this file as part of a free
00018 // software project without restriction.  Specifically, if other files
00019 // instantiate templates or use macros or inline functions from this
00020 // file, or you compile this file and link it with other files to produce
00021 // an executable, this file does not by itself cause the resulting
00022 // executable to be covered by the GNU General Public License.  This
00023 // exception does not however invalidate any other reasons why the
00024 // executable file might be covered by the GNU General Public License.
00025 
00026 #ifndef MLN_TOPO_CENTERED_ITER_ADAPTER_HH
00027 # define MLN_TOPO_CENTERED_ITER_ADAPTER_HH
00028 
00032 
00033 # include <mln/topo/internal/complex_relative_iterator_sequence.hh>
00034 # include <mln/topo/center_only_iter.hh>
00035 
00036 # include <mln/topo/face.hh>
00037 
00038 
00039 namespace mln
00040 {
00041 
00042   namespace topo
00043   {
00044 
00045     /*----------------------------------------.
00046     | topo::centered_fwd_iter_adapter<D, I>.  |
00047     `----------------------------------------*/
00048 
00049     // FIXME: We should deduce D from I.
00050 
00056     template <unsigned D, typename I>
00057     class centered_fwd_iter_adapter
00058       : public internal::complex_relative_iterator_sequence< center_only_iter<D>,
00059                                                              I,
00060                                                              centered_fwd_iter_adapter<D, I> >
00061     {
00062       typedef centered_fwd_iter_adapter<D, I> self_;
00063       typedef center_only_iter<D> iter1_;
00064       typedef I iter2_;
00065       typedef internal::complex_relative_iterator_sequence< iter1_,
00066                                                             iter2_,
00067                                                             self_ > super_;
00068 
00069     public:
00072       centered_fwd_iter_adapter();
00073       template <typename Fref>
00074       centered_fwd_iter_adapter(const Fref& f_ref);
00076     };
00077 
00078 
00079     /*----------------------------------------.
00080     | topo::centered_bkd_iter_adapter<D, I>.  |
00081     `----------------------------------------*/
00082 
00083     // FIXME: We should deduce D from I.
00084 
00090     template <unsigned D, typename I>
00091     class centered_bkd_iter_adapter
00092       : public internal::complex_relative_iterator_sequence< I,
00093                                                              center_only_iter<D>,
00094                                                              centered_bkd_iter_adapter<D, I> >
00095     {
00096       typedef centered_bkd_iter_adapter<D, I> self_;
00097       typedef I iter1_;
00098       typedef center_only_iter<D> iter2_;
00099       typedef internal::complex_relative_iterator_sequence< iter1_,
00100                                                             iter2_,
00101                                                             self_ > super_;
00102 
00103     public:
00106       centered_bkd_iter_adapter();
00107       template <typename Fref>
00108       centered_bkd_iter_adapter(const Fref& f_ref);
00110     };
00111 
00112 
00113 
00114 # ifndef MLN_INCLUDE_ONLY
00115 
00116     /*----------------------------------------.
00117     | topo::centered_fwd_iter_adapter<D, I>.  |
00118     `----------------------------------------*/
00119 
00120     template <unsigned D, typename I>
00121     inline
00122     centered_fwd_iter_adapter<D, I>::centered_fwd_iter_adapter()
00123     {
00124     }
00125 
00126     template <unsigned D, typename I>
00127     template <typename Fref>
00128     inline
00129     centered_fwd_iter_adapter<D, I>::centered_fwd_iter_adapter(const Fref& f_ref)
00130       : super_(f_ref)
00131     {
00132     }
00133 
00134 
00135     /*----------------------------------------.
00136     | topo::centered_bkd_iter_adapter<D, I>.  |
00137     `----------------------------------------*/
00138 
00139     template <unsigned D, typename I>
00140     inline
00141     centered_bkd_iter_adapter<D, I>::centered_bkd_iter_adapter()
00142     {
00143     }
00144 
00145     template <unsigned D, typename I>
00146     template <typename Fref>
00147     inline
00148     centered_bkd_iter_adapter<D, I>::centered_bkd_iter_adapter(const Fref& f_ref)
00149       : super_(f_ref)
00150     {
00151     }
00152 
00153 # endif // ! MLN_INCLUDE_ONLY
00154 
00155   } // end of namespace mln::topo
00156 
00157 } // end of namespace mln
00158 
00159 #endif // ! MLN_TOPO_CENTERED_ITER_ADAPTER_HH

Generated on Tue Oct 4 2011 15:23:34 for Milena (Olena) by  doxygen 1.7.1