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

graph_window_base.hh

00001 // Copyright (C) 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_INTERNAL_GRAPH_WINDOW_BASE_HH
00027 # define MLN_CORE_INTERNAL_GRAPH_WINDOW_BASE_HH
00028 
00029 # include <mln/core/concept/window.hh>
00030 
00034 
00035 namespace mln
00036 {
00037 
00039   template <typename P, typename E>
00040   class graph_window_base : public Window<E>
00041   {
00042     typedef graph_window_base<P, E> self_;
00043 
00044   public:
00048     typedef P site;
00049 
00050     // FIXME: This is a dummy value.
00051     typedef void dpsite;
00053 
00057     bool is_empty() const;
00059     bool is_centered() const;
00061     // FIXME: We should define this more precisely.
00062     bool is_symmetric() const;
00065     /* FIXME: This method returns a dummy value (0), since the delta
00066        of a window on a graph/line_graph
00067 
00068        1. is not constant (line graph edges/graph vertices are not necessarily
00069           aligned on a regular grid);
00070 
00071        2. depends on the underlying line_graph/graph, too.
00072 
00073        It raises another question: should delta() be part of the
00074        concept ``Window''?  */
00075     unsigned delta() const;
00077     self_& sym();
00078 
00080     bool is_neighbable_() const;
00082 
00084     bool is_valid() const;
00085 
00086   protected:
00087     graph_window_base();
00088   };
00089 
00090 
00091 # ifndef MLN_INCLUDE_ONLY
00092 
00093 
00094 
00095   template <typename P, typename E>
00096   inline
00097   graph_window_base<P,E>::graph_window_base()
00098   {
00099   }
00100 
00101   template <typename P, typename E>
00102   inline
00103   bool
00104   graph_window_base<P,E>::is_empty() const
00105   {
00106     return false;
00107   }
00108 
00109   template <typename P, typename E>
00110   inline
00111   bool
00112   graph_window_base<P,E>::is_centered() const
00113   {
00114     return false;
00115   }
00116 
00117   template <typename P, typename E>
00118   inline
00119   bool
00120   graph_window_base<P,E>::is_symmetric() const
00121   {
00122     return true;
00123   }
00124 
00125   template <typename P, typename E>
00126   inline
00127   unsigned
00128   graph_window_base<P,E>::delta() const
00129   {
00130     // Dummy value (see the interface of the method above).
00131     return 0;
00132   }
00133 
00134   template <typename P, typename E>
00135   inline
00136   graph_window_base<P,E>&
00137   graph_window_base<P,E>::sym()
00138   {
00139     return *this;
00140   }
00141 
00142   template <typename P, typename E>
00143   inline
00144   bool
00145   graph_window_base<P,E>::is_neighbable_() const
00146   {
00147     return true;
00148   }
00149 
00150   template <typename P, typename E>
00151   inline
00152   bool
00153   graph_window_base<P,E>::is_valid() const
00154   {
00155     return true;
00156   }
00157 
00158 
00159 
00160 # endif // !MLN_INCLUDE_ONLY
00161 
00162 } // end of namespace mln
00163 
00164 #endif // ! MLN_CORE_INTERNAL_GRAPH_WINDOW_BASE_HH

Generated on Tue Oct 4 2011 15:23:51 for Milena (Olena) by  doxygen 1.7.1