2449: Add edge_impl_ and vertex_impl_.

--- milena/mln/util/internal/graph_edge.hh | 4 +- milena/mln/util/internal/graph_edge_impl.hh | 89 +++++++++++++++++++++++++ milena/mln/util/internal/graph_vertex.hh | 4 +- milena/mln/util/internal/graph_vertex_impl.hh | 89 +++++++++++++++++++++++++ 4 files changed, 184 insertions(+), 2 deletions(-) create mode 100644 milena/mln/util/internal/graph_edge_impl.hh create mode 100644 milena/mln/util/internal/graph_vertex_impl.hh diff --git a/milena/mln/util/internal/graph_edge.hh b/milena/mln/util/internal/graph_edge.hh index 78a00c2..24bb716 100644 --- a/milena/mln/util/internal/graph_edge.hh +++ b/milena/mln/util/internal/graph_edge.hh @@ -28,6 +28,8 @@ #ifndef MLN_UTIL_INTERNAL_GRAPH_EDGE_HH # define MLN_UTIL_INTERNAL_GRAPH_EDGE_HH +# include <mln/util/internal/graph_edge_impl.hh> + /*! \file mln/util/internal/graph_edge.hh * \brief Definition of a graph edge. */ @@ -44,7 +46,7 @@ namespace mln /// \brief Edge of a graph \p G. template <typename G> - class edge + class edge : public internal::edge_impl_<G> { typedef mlc_const(G) graph_t; diff --git a/milena/mln/util/internal/graph_edge_impl.hh b/milena/mln/util/internal/graph_edge_impl.hh new file mode 100644 index 0000000..2ed90c5 --- /dev/null +++ b/milena/mln/util/internal/graph_edge_impl.hh @@ -0,0 +1,89 @@ +// Copyright (C) 2008 EPITA Research and Development Laboratory +// +// This file is part of the Olena Library. This library is free +// software; you can redistribute it and/or modify it under the terms +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to +// produce an executable, this file does not by itself cause the +// resulting executable to be covered by the GNU General Public +// License. This exception does not however invalidate any other +// reasons why the executable file might be covered by the GNU General +// Public License. + +#ifndef MLN_CORE_INTERNAL_EDGE_IMPL_HH +# define MLN_CORE_INTERNAL_EDGE_IMPL_HH + +/*! \file mln/core/internal/edge_impl.hh + * + * \brief Define a couple of implementation classes to provide methods + * to classes of generalized edges. + */ + +# include <mln/core/internal/force_exact.hh> + + +namespace mln +{ + + namespace util + { + + namespace internal + { + + /// Implementation class to equip generalized edge classes. + template <typename G> + class edge_impl_ + { + protected: + edge_impl_(); + }; + + } // end of namespace internal + + } // end of namespace util + +} // end of namespace mln + +#ifndef MLN_INCLUDE_ONLY + +namespace mln +{ + + namespace util + { + + namespace internal + { + + template <typename G> + inline + edge_impl_<G>::edge_impl_() + { + } + + } // end of namespace internal + + } // end of namespace util + +} // end of namespace mln + +#endif // ! MLN_INCLUDE_ONLY + + +#endif // ! MLN_CORE_INTERNAL_EDGE_IMPL_HH diff --git a/milena/mln/util/internal/graph_vertex.hh b/milena/mln/util/internal/graph_vertex.hh index c40bf0f..fc4ff2b 100644 --- a/milena/mln/util/internal/graph_vertex.hh +++ b/milena/mln/util/internal/graph_vertex.hh @@ -28,6 +28,8 @@ #ifndef MLN_UTIL_INTERNAL_GRAPH_VERTEX_HH # define MLN_UTIL_INTERNAL_GRAPH_VERTEX_HH +# include <mln/util/internal/graph_vertex_impl.hh> + /// \file mln/util/internal/graph_vertex.hh /// \brief Implementation of a graph vertex. @@ -39,7 +41,7 @@ namespace mln /// \brief Vertex of a graph \p G. template<typename G> - class vertex + class vertex : public internal::vertex_impl_<G> { typedef mlc_const(G) graph_t; diff --git a/milena/mln/util/internal/graph_vertex_impl.hh b/milena/mln/util/internal/graph_vertex_impl.hh new file mode 100644 index 0000000..863cf25 --- /dev/null +++ b/milena/mln/util/internal/graph_vertex_impl.hh @@ -0,0 +1,89 @@ +// Copyright (C) 2008 EPITA Research and Development Laboratory +// +// This file is part of the Olena Library. This library is free +// software; you can redistribute it and/or modify it under the terms +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to +// produce an executable, this file does not by itself cause the +// resulting executable to be covered by the GNU General Public +// License. This exception does not however invalidate any other +// reasons why the executable file might be covered by the GNU General +// Public License. + +#ifndef MLN_CORE_INTERNAL_VERTEX_IMPL_HH +# define MLN_CORE_INTERNAL_VERTEX_IMPL_HH + +/*! \file mln/core/internal/vertex_impl.hh + * + * \brief Define a couple of implementation classes to provide methods + * to classes of generalized vertexs. + */ + +# include <mln/core/internal/force_exact.hh> + + +namespace mln +{ + + namespace util + { + + namespace internal + { + + /// Implementation class to equip generalized vertex classes. + template <typename G> + class vertex_impl_ + { + protected: + vertex_impl_(); + }; + + } // end of namespace internal + + } // end of namespace util + +} // end of namespace mln + +#ifndef MLN_INCLUDE_ONLY + +namespace mln +{ + + namespace util + { + + namespace internal + { + + template <typename G> + inline + vertex_impl_<G>::vertex_impl_() + { + } + + } // end of namespace internal + + } // end of namespace util + +} // end of namespace mln + +#endif // ! MLN_INCLUDE_ONLY + + +#endif // ! MLN_CORE_INTERNAL_VERTEX_IMPL_HH -- 1.5.6.5
participants (1)
-
Guillaume Lazzara