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

graph_elt_window.hh

00001 // Copyright (C) 2007, 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_CORE_IMAGE_GRAPH_ELT_WINDOW_HH
00027 # define MLN_CORE_IMAGE_GRAPH_ELT_WINDOW_HH
00028 
00032 
00033 # include <mln/core/concept/window.hh>
00034 # include <mln/core/internal/neighborhood_base.hh>
00035 # include <mln/core/internal/graph_window_base.hh>
00036 # include <mln/core/image/graph_window_piter.hh>
00037 
00038 
00039 namespace mln
00040 {
00041 
00043   template <typename G, typename S> class graph_elt_window;
00044   template <typename G, typename F> struct p_edges;
00045   template <typename G, typename F> struct p_vertices;
00046 
00047 
00048   namespace internal
00049   {
00050 
00051     template <typename G, typename S, typename E>
00052     struct neighborhood_impl<graph_elt_window<G,S>,E>
00053       : public neighborhood_extra_impl<graph_elt_window<G,S>,E>
00054     {
00055     };
00056 
00057 
00060     template <typename G, typename S>
00061     struct graph_window_iter_dispatch;
00062 
00063     template <typename G, typename F>
00064     struct graph_window_iter_dispatch<G, p_edges<G,F> >
00065     {
00066       typedef mln_edge_nbh_edge_fwd_iter(G) nbh_fwd_iter_;
00067       typedef mln_edge_nbh_edge_bkd_iter(G) nbh_bkd_iter_;
00068     };
00069 
00070     template <typename G, typename F>
00071     struct graph_window_iter_dispatch<G, p_vertices<G,F> >
00072     {
00073       typedef mln_vertex_nbh_vertex_fwd_iter(G) nbh_fwd_iter_;
00074       typedef mln_vertex_nbh_vertex_bkd_iter(G) nbh_bkd_iter_;
00075     };
00076 
00077 
00078   } // end of namespace mln::internal
00079 
00080 
00081   namespace trait
00082   {
00083 
00084     template <typename G, typename S>
00085     struct window_< mln::graph_elt_window<G,S> >
00086     {
00087       typedef trait::window::size::unknown       size;
00088       typedef trait::window::support::irregular  support;
00089       typedef trait::window::definition::varying definition;
00090     };
00091 
00092   } // end of namespace mln::trait
00093 
00094 
00098   template <typename G, typename S>
00099   class graph_elt_window
00100     : public graph_window_base<mln_result(S::fun_t),
00101                                graph_elt_window<G,S> >,
00102       public internal::graph_window_iter_dispatch<G,S>
00103   {
00104     typedef graph_elt_window<G,S> self_;
00105     typedef internal::graph_window_iter_dispatch<G,S> super_;
00106 
00107     typedef typename super_::nbh_fwd_iter_ nbh_fwd_iter_;
00108     typedef typename super_::nbh_bkd_iter_ nbh_bkd_iter_;
00109 
00110   public:
00113     typedef S target;
00115     typedef mln_psite(target) psite;
00116 
00119     typedef graph_window_piter<target,self_,nbh_fwd_iter_> fwd_qiter;
00120 
00123     typedef graph_window_piter<target,self_,nbh_bkd_iter_> bkd_qiter;
00124 
00126     typedef fwd_qiter qiter;
00128 
00129   };
00130 
00131 } // end of namespace mln
00132 
00133 
00134 #endif // ! MLN_CORE_IMAGE_GRAPH_ELT_WINDOW_HH

Generated on Thu Sep 8 2011 18:31:52 for Milena (Olena) by  doxygen 1.7.1