Milena (Olena)
User documentation 2.0a Id
|
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_CONCEPT_WEIGHTED_WINDOW_HH 00027 # define MLN_CORE_CONCEPT_WEIGHTED_WINDOW_HH 00028 00034 00035 # include <mln/core/concept/object.hh> 00036 # include <mln/core/concept/iterator.hh> 00037 # include <mln/trait/windows.hh> 00038 00039 00040 00041 # define mln_is_simple_weighted_window(W) \ 00042 mln_is_simple_window(typename W::window) 00043 00044 00045 00046 namespace mln 00047 { 00048 00049 // Forward declaration. 00050 template <typename E> struct Weighted_Window; 00051 00052 00053 // Weighted_Window category flag type. 00054 template <> 00055 struct Weighted_Window<void> 00056 { 00057 typedef Object<void> super; 00058 }; 00059 00060 00067 template <typename E> 00068 struct Weighted_Window : public Object<E> 00069 { 00070 typedef Weighted_Window<void> category; 00071 00072 /* 00073 typedef fwd_qiter; 00074 typedef bkd_piter; 00075 00076 typedef dpsite; 00077 typedef psite; 00078 typedef site; 00079 typedef weight; 00080 typedef window; 00081 00082 void sym(); 00083 */ 00084 00085 protected: 00086 Weighted_Window(); 00087 }; 00088 00089 00094 template <typename W> 00095 W operator-(const Weighted_Window<W>& rhs); 00096 00097 00098 00099 # ifndef MLN_INCLUDE_ONLY 00100 00101 template <typename E> 00102 inline 00103 Weighted_Window<E>::Weighted_Window() 00104 { 00105 typedef mln_site(E) site; 00106 typedef mln_psite(E) psite; 00107 typedef mln_dpsite(E) dpsite; 00108 00109 typedef mln_weight(E) weight; 00110 typedef mln_window(E) window; 00111 00112 typedef mln_fwd_qiter(E) fwd_qiter; 00113 typedef mln_bkd_qiter(E) bkd_qiter; 00114 00115 void (E::*m1)() = & E::sym; 00116 m1 = 0; 00117 00118 const window& (E::*m2)() const = & E::win; 00119 m2 = 0; 00120 } 00121 00122 # endif // ! MLN_INCLUDE_ONLY 00123 00124 } // end of namespace mln 00125 00126 00127 #endif // ! MLN_CORE_CONCEPT_WEIGHTED_WINDOW_HH