00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 #ifndef MLN_CORE_NEIGHB_HH
00028 # define MLN_CORE_NEIGHB_HH
00029 
00037 
00038 # include <mln/core/internal/neighb_base.hh>
00039 # include <mln/core/internal/neighb_niter_base.hh>
00040 # include <mln/core/internal/site_relative_iterator_base.hh>
00041 # include <mln/core/internal/neighb_niter_impl.hh>
00042 
00043 
00044 namespace mln
00045 {
00046 
00047   
00048   template <typename W> class neighb_fwd_niter;
00049   template <typename W> class neighb_bkd_niter;
00050   template <typename W> class neighb;
00051 
00052 
00053   namespace convert
00054   {
00055 
00056     namespace over_load
00057     {
00058 
00059       template <typename W>
00060       void
00061       from_to_(const mln::neighb<W>& from, W& to);
00062 
00063       template <typename W>
00064       void
00065       from_to_(const W& from, mln::neighb<W>& to);
00066 
00067     } 
00068 
00069   } 
00070 
00071 
00072 
00074 
00075   template <typename W>
00076   class neighb
00077     : public internal::neighb_base<W,neighb<W> >
00078   {
00079     typedef internal::neighb_base<W,neighb<W> > super_;
00080 
00081   public:
00082 
00084     typedef neighb_fwd_niter<W> fwd_niter;
00085 
00087     typedef neighb_bkd_niter<W> bkd_niter;
00088 
00090     typedef fwd_niter niter;
00091 
00092 
00094     neighb();
00095 
00097     neighb(const W& win);
00098 
00099   };
00100 
00101 
00102   
00103 
00104   template <typename W>
00105   class neighb_fwd_niter
00106     : public internal::neighb_niter_base<W,neighb<W>,
00107                                          mln_fwd_qiter(W),neighb_fwd_niter<W> >
00108   {
00109     typedef
00110       internal::neighb_niter_base<W,neighb<W>,
00111                                   mln_fwd_qiter(W),neighb_fwd_niter<W> > super_;
00112 
00113   public:
00114     neighb_fwd_niter();
00115 
00116     template <typename P>
00117     neighb_fwd_niter(const neighb<W>& nbh, const P& c);
00118 
00119   };
00120 
00121 
00122 
00123   
00124 
00125   template <typename W>
00126   class neighb_bkd_niter
00127     : public internal::neighb_niter_base<W,neighb<W>,
00128                                          mln_bkd_qiter(W),neighb_bkd_niter<W> >
00129   {
00130     typedef
00131       internal::neighb_niter_base<W,neighb<W>,
00132                                   mln_bkd_qiter(W),neighb_bkd_niter<W> > super_;
00133 
00134   public:
00135     neighb_bkd_niter();
00136 
00137     template <typename P>
00138     neighb_bkd_niter(const neighb<W>& nbh, const P& c);
00139 
00140   };
00141 
00142 
00143 
00144 # ifndef MLN_INCLUDE_ONLY
00145 
00146   
00147 
00148   template <typename W>
00149   inline
00150   neighb<W>::neighb()
00151   {
00152   }
00153 
00154   template <typename W>
00155   inline
00156   neighb<W>::neighb(const W& win)
00157     : super_(win)
00158   {
00159   }
00160 
00161 
00162   
00163 
00164   namespace convert
00165   {
00166 
00167     namespace over_load
00168     {
00169 
00170       template <typename W>
00171       void
00172       from_to_(const mln::neighb<W>& from, W& to)
00173       {
00174         to = from.win();
00175       }
00176 
00177       template <typename W>
00178       void
00179       from_to_(const W& from, mln::neighb<W>& to)
00180       {
00181         to.change_window(from);
00182       }
00183 
00184     } 
00185 
00186   } 
00187 
00188 
00189 
00190 
00191   
00192 
00193   template <typename W>
00194   inline
00195   neighb_fwd_niter<W>::neighb_fwd_niter()
00196   {
00197   }
00198 
00199   template <typename W>
00200   template <typename P>
00201   inline
00202   neighb_fwd_niter<W>::neighb_fwd_niter(const neighb<W>& nbh, const P& c)
00203     : super_(nbh, c)
00204   {
00205     this->i_.init_(nbh.win(), c);
00206   }
00207 
00208 
00209 
00210   
00211 
00212   template <typename W>
00213   inline
00214   neighb_bkd_niter<W>::neighb_bkd_niter()
00215   {
00216   }
00217 
00218   template <typename W>
00219   template <typename P>
00220   inline
00221   neighb_bkd_niter<W>::neighb_bkd_niter(const neighb<W>& nbh, const P& c)
00222     : super_(nbh, c)
00223   {
00224     this->i_.init_(nbh.win(), c);
00225   }
00226 
00227 
00228 # endif // ! MLN_INCLUDE_ONLY
00229 
00230 } 
00231 
00232 
00233 #endif // ! MLN_CORE_NEIGHB_HH