bkd-dir-iter.hh

00001 
00002 // Copyright (C) 2001, 2002, 2003, 2004  EPITA Research and Development Laboratory
00003 //
00004 // This file is part of the Olena Library.  This library is free
00005 // software; you can redistribute it and/or modify it under the terms
00006 // of the GNU General Public License version 2 as published by the
00007 // Free Software Foundation.
00008 //
00009 // This library 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 this library; see the file COPYING.  If not, write to
00016 // the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
00017 // MA 02111-1307, USA.
00018 //
00019 // As a special exception, you may use this file as part of a free
00020 // software library without restriction.  Specifically, if other files
00021 // instantiate templates or use macros or inline functions from this
00022 // file, or you compile this file and link it with other files to
00023 // produce an executable, this file does not by itself cause the
00024 // resulting executable to be covered by the GNU General Public
00025 // License.  This exception does not however invalidate any other
00026 // reasons why the executable file might be covered by the GNU General
00027 // Public License.
00028 
00029 #ifndef OLENA_TOPO_INTER_PIXEL_BKD_DIR_ITERHH
00030 # define OLENA_TOPO_INTER_PIXEL_BKD_DIR_ITER_HH
00031 
00032 # include <oln/core/abstract/iter.hh>
00033 # include <oln/topo/inter-pixel/internal/dir-iter.hh>
00034 
00035 namespace oln {
00036 
00037   namespace topo {
00038 
00039     namespace inter_pixel {
00040       template<unsigned Dim, class Exact = mlc::final>
00041       class bkd_dir_iter; // fwd_decl
00042     }
00043 
00044   }
00045 
00046   template<unsigned Dim, class Exact>
00047   struct iter_traits<topo::inter_pixel::bkd_dir_iter<Dim, Exact> >
00048     : public iter_traits<topo::inter_pixel::internal::dir_iter_<Dim, typename
00049       mlc::exact_vt<topo::inter_pixel::bkd_dir_iter<Dim, Exact>, Exact>::ret> >
00050   {};
00051 
00052   namespace topo {
00053 
00054     namespace inter_pixel {
00056       template<unsigned Dim, class Exact>
00057       class bkd_dir_iter
00058         : public internal::dir_iter_<Dim, typename mlc::exact_vt<bkd_dir_iter<Dim, Exact>, Exact>::ret>
00059       {
00060       private:
00061         typedef internal::dir_iter_<Dim, typename mlc::exact_vt<bkd_dir_iter<Dim, Exact>, Exact>::ret> super;
00062         typedef typename super::dir_type dir_type;
00063 
00064       public:
00065         bkd_dir_iter() : super(), begin_(internal::dir_traits<Dim>::last()) {}
00066         bkd_dir_iter(dir_type i) : super(i), begin_(i) {}
00067 
00072         template<class U>
00073         U
00074         operator=(U u) { return super::operator=(u); }
00075 
00077         dir_type
00078         next()
00079         {
00080           return internal::dir_traits<Dim>::prev(this->cur_);
00081         }
00082 
00084         dir_type
00085         begin()
00086         {
00087           return begin_;
00088         }
00089 
00090       private:
00091         dir_type begin_;
00092       };
00093 
00095 # define oln_bkd_dir_iter_type(ImgType)         \
00096 oln::topo::inter_pixel::bkd_dir_iter< ImgType::dim >
00097 
00098     } // end of namespace inter_pixel
00099 
00100   } // end of namespace topo
00101 
00102 } // end of namespace oln
00103 
00104 #endif // ! OLENA_TOPO_INTER_PIXEL_BKD_DIR_ITER_HH

Generated on Thu Apr 15 20:13:06 2004 for Olena by doxygen 1.3.6-20040222