fwd-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_FWD_DIR_ITER_HH
00030 # define OLENA_TOPO_INTER_PIXEL_FWD_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 fwd_dir_iter; // fwd_decl
00042     }
00043 
00044   }
00045 
00046   template<unsigned Dim, class Exact>
00047   struct iter_traits<topo::inter_pixel::fwd_dir_iter<Dim, Exact> >
00048     : public iter_traits<topo::inter_pixel::internal::dir_iter_<Dim, typename
00049       mlc::exact_vt<topo::inter_pixel::fwd_dir_iter<Dim, Exact>, Exact>::ret> >
00050   {
00051 
00052   };
00053 
00054   namespace topo {
00055 
00056     namespace inter_pixel {
00058       template<unsigned Dim, class Exact>
00059       class fwd_dir_iter
00060         : public internal::dir_iter_<Dim, typename mlc::exact_vt<fwd_dir_iter<Dim, Exact>, Exact>::ret>
00061       {
00062       private:
00063         typedef internal::dir_iter_<Dim, typename mlc::exact_vt<fwd_dir_iter<Dim, Exact>, Exact>::ret> super;
00064         typedef typename super::dir_type dir_type;
00065 
00066       public:
00067         fwd_dir_iter() : super(), begin_(internal::dir_traits<Dim>::first()) {}
00068         fwd_dir_iter(dir_type i) : super(i), begin_(i) {}
00069 
00074         template<class U>
00075         U
00076         operator=(U u)
00077         {
00078           return super::operator=(u);
00079         }
00080 
00082         dir_type
00083         next()
00084         {
00085           return internal::dir_traits<Dim>::next(this->cur_);
00086         }
00087 
00089         dir_type
00090         begin()
00091         {
00092           return begin_;
00093         }
00094 
00095       private:
00096         dir_type begin_;
00097       };
00099 # define oln_fwd_dir_iter_type(ImgType)                 \
00100 oln::topo::inter_pixel::fwd_dir_iter< ImgType::dim >
00101 
00102     } // end of namespace inter_pixel
00103 
00104   } // end of namespace topo
00105 
00106 } // end of namespace oln
00107 
00108 #endif // ! OLENA_TOPO_INTER_PIXEL_FWD_DIR_ITER_HH

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