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 #ifndef MLN_CORE_MIXED_NEIGHB_HH
00027 # define MLN_CORE_MIXED_NEIGHB_HH
00028 
00039 
00040 # include <mln/core/neighb.hh>
00041 # include <mln/core/internal/neighb_base.hh>
00042 # include <mln/core/internal/neighb_niter_base.hh>
00043 # include <mln/core/internal/site_relative_iterator_base.hh>
00044 # include <mln/core/internal/neighb_niter_impl.hh>
00045 
00046 
00047 namespace mln
00048 {
00049 
00050   
00051   template <typename W> class mixed_neighb_fwd_niter;
00052   template <typename W> class mixed_neighb_bkd_niter;
00053   template <typename W> class mixed_neighb;
00054 
00055 
00056   namespace convert
00057   {
00058 
00059     namespace over_load
00060     {
00061 
00062       template <typename W>
00063       void
00064       from_to_(const mln::mixed_neighb<W>& from, W& to);
00065 
00066       template <typename W>
00067       void
00068       from_to_(const W& from, mln::mixed_neighb<W>& to);
00069 
00070     } 
00071 
00072   } 
00073 
00074 
00075 
00077 
00078   template <typename W>
00079   class mixed_neighb
00080     : public internal::neighb_base<W,mixed_neighb<W> >,
00081       private mlc_is_a(W, Window)::check_t
00082   {
00083     typedef internal::neighb_base<W,mixed_neighb<W> > super_;
00084 
00085   public:
00086 
00088     typedef mixed_neighb_fwd_niter<W> fwd_niter;
00089 
00091     typedef mixed_neighb_bkd_niter<W> bkd_niter;
00092 
00094     typedef fwd_niter niter;
00095 
00096 
00098     mixed_neighb();
00099 
00101     mixed_neighb(const W& win);
00102 
00103   };
00104 
00105 
00106   
00107 
00108   template <typename W>
00109   class mixed_neighb_fwd_niter
00110     : public internal::neighb_niter_base<W,mixed_neighb<W>,
00111                                          mln_fwd_qiter(W),neighb_fwd_niter<W> >
00112   {
00113     typedef
00114       internal::neighb_niter_base<W,mixed_neighb<W>,
00115                                   mln_fwd_qiter(W),neighb_fwd_niter<W> > super_;
00116 
00117   public:
00118     mixed_neighb_fwd_niter();
00119 
00120     template <typename P>
00121     mixed_neighb_fwd_niter(const mixed_neighb<W>& nbh,
00122                            const mln_target(W)& nbh_site_set,
00123                            const P& c);
00124 
00125   };
00126 
00127 
00128 
00129   
00130 
00131   template <typename W>
00132   class mixed_neighb_bkd_niter
00133     : public internal::neighb_niter_base<W,mixed_neighb<W>,
00134                                          mln_bkd_qiter(W),neighb_bkd_niter<W> >
00135   {
00136     typedef
00137       internal::neighb_niter_base<W,mixed_neighb<W>,
00138                                   mln_bkd_qiter(W),neighb_bkd_niter<W> > super_;
00139 
00140   public:
00141     mixed_neighb_bkd_niter();
00142 
00143     template <typename P>
00144     mixed_neighb_bkd_niter(const mixed_neighb<W>& nbh,
00145                            const mln_target(W)& nbh_site_set,
00146                            const P& c);
00147 
00148   };
00149 
00150 
00151 
00152 # ifndef MLN_INCLUDE_ONLY
00153 
00154   
00155 
00156   template <typename W>
00157   inline
00158   mixed_neighb<W>::mixed_neighb()
00159   {
00160   }
00161 
00162   template <typename W>
00163   inline
00164   mixed_neighb<W>::mixed_neighb(const W& win)
00165     : super_(win)
00166   {
00167   }
00168 
00169 
00170   
00171 
00172   namespace convert
00173   {
00174 
00175     namespace over_load
00176     {
00177 
00178       template <typename W>
00179       void
00180       from_to_(const mln::mixed_neighb<W>& from, W& to)
00181       {
00182         to = from.win();
00183       }
00184 
00185       template <typename W>
00186       void
00187       from_to_(const W& from, mln::mixed_neighb<W>& to)
00188       {
00189         to.change_window(from);
00190       }
00191 
00192     } 
00193 
00194   } 
00195 
00196 
00197 
00198 
00199   
00200 
00201   template <typename W>
00202   inline
00203   mixed_neighb_fwd_niter<W>::mixed_neighb_fwd_niter()
00204   {
00205   }
00206 
00207   template <typename W>
00208   template <typename P>
00209   inline
00210   mixed_neighb_fwd_niter<W>::mixed_neighb_fwd_niter(const mixed_neighb<W>& nbh,
00211                                                     const mln_target(W)& nbh_site_set,
00212                                                     const P& c)
00213     : super_(nbh, c)
00214   {
00215     this->i_.init_(nbh.win(), nbh_site_set, c);
00216   }
00217 
00218 
00219 
00220   
00221 
00222   template <typename W>
00223   inline
00224   mixed_neighb_bkd_niter<W>::mixed_neighb_bkd_niter()
00225   {
00226   }
00227 
00228   template <typename W>
00229   template <typename P>
00230   inline
00231   mixed_neighb_bkd_niter<W>::mixed_neighb_bkd_niter(const mixed_neighb<W>& nbh,
00232                                                     const mln_target(W)& nbh_site_set,
00233                                                     const P& c)
00234     : super_(nbh, c)
00235   {
00236     this->i_.init_(nbh.win(), nbh_site_set, c);
00237   }
00238 
00239 
00240 # endif // ! MLN_INCLUDE_ONLY
00241 
00242 } 
00243 
00244 
00245 #endif // ! MLN_CORE_MIXED_NEIGHB_HH