3084: Add forward declarations for all init_() functions.

* core/routine/init.hh: include init.hxx. * core/routine/init.hxx: references all the init_() functions. Must be updated each time a new init_() is added. This file must be used like convert/from_to.hxx. --- milena/ChangeLog | 14 +++++- milena/mln/core/routine/init.hh | 12 +++--- milena/mln/core/routine/init.hxx | 92 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 110 insertions(+), 8 deletions(-) create mode 100644 milena/mln/core/routine/init.hxx diff --git a/milena/ChangeLog b/milena/ChangeLog index 32d2dcd..5936533 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,4 +1,14 @@ -2008-12-22 Guillaume Lazzara <z@lrde.epita.fr> +2008-12-29 Guillaume Lazzara <z@lrde.epita.fr> + + Add forward declarations for all init_() functions. + + * core/routine/init.hh: include init.hxx. + + * core/routine/init.hxx: references all the init_() functions. Must be + updated each time a new init_() is added. This file must be used like + convert/from_to.hxx. + +2008-12-29 Guillaume Lazzara <z@lrde.epita.fr> Fix compilation issues. @@ -22,7 +32,7 @@ * tests/unit_test/mln_data_all.cc * tests/unit_test/mln_data_essential.cc: add new unit tests. -2008-12-22 Guillaume Lazzara <z@lrde.epita.fr> +2008-12-29 Guillaume Lazzara <z@lrde.epita.fr> Add a dispatch in from_to. diff --git a/milena/mln/core/routine/init.hh b/milena/mln/core/routine/init.hh index 5b0f9ed..476c374 100644 --- a/milena/mln/core/routine/init.hh +++ b/milena/mln/core/routine/init.hh @@ -28,23 +28,23 @@ #ifndef MLN_CORE_ROUTINE_INIT_HH # define MLN_CORE_ROUTINE_INIT_HH -/*! \file mln/core/routine/init.hh - * - * \brief Definition of function that initialize an image from another - * one. - */ +/// \file mln/core/routine/init.hh +/// +/// Definition of function that initialize an image from another +/// one. # include <mln/tag/init.hh> # include <mln/geom/bbox.hh> # include <mln/border/find.hh> +# include <core/routine/init.hxx> namespace mln { - // Fwd decl. + // Forward declaration. template <typename Subject, typename T, typename M> void init_(Subject, T& target, const Object<M>& model); diff --git a/milena/mln/core/routine/init.hxx b/milena/mln/core/routine/init.hxx new file mode 100644 index 0000000..cfeb5ea --- /dev/null +++ b/milena/mln/core/routine/init.hxx @@ -0,0 +1,92 @@ +// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE) +// +// 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_ROUTINE_INIT_HXX +# define MLN_CORE_ROUTINE_INIT_HXX + +/// \file mln/core/routine/init.hxx +/// +// All overloaded "mln::init" routines have to be declared in +// the present file. It allows for *deferred* use of these routines. + +namespace mln +{ + + // Forward declarations. + namespace fun { namespace i2v { template <typename T> class array; } } + namespace fun { namespace l2l { template <typename T> class relabel; } } + namespace pw { template <typename F, typename S> class image; } + template <typename I, typename F> class image_if; + + + + /// Kind: function_t + /// Type: F, + /// From: pw::image<F,S> + template <typename F, typename S> + void init_(tag::function_t, F& f, const pw::image<F,S>& model); + + + /// Kind: image_t + /// Type: pw::image<F,S> + /// From: J + template <typename F, typename S, typename J> + void init_(tag::image_t, mln::pw::image<F,S>& target, const J& model); + + + /// Kind: function_t + /// Type: F + /// From: image_if<I,F> + template <typename I, typename F> + void init_(tag::function_t, F& f, const image_if<I,F>& model); + + /// Kind: image_t + /// Type: F + /// From: J + template <typename I, typename F, typename J> + void init_(tag::image_t, image_if<I,F>& target, const J& model); + + + /// Kind: function_t + /// Type: fun::i2v::array<T1> + /// From: fun::i2v::array<T2> + template <typename T1, typename T2> + void init_(tag::function_t, + fun::i2v::array<T1>& f, + const fun::i2v::array<T2>& model); + + /// Kind: function_t + /// Type: fun::l2l::relabel<T1> + /// From: fun::l2l::relabel<T2> + template <typename T1, typename T2> + void init_(tag::function_t, + fun::l2l::relabel<T1>& f, + const fun::l2l::relabel<T2>& model); + +} // end of namespace mln + +#endif // ! MLN_CORE_ROUTINE_INIT_HXX -- 1.5.6.5
participants (1)
-
Guillaume Lazzara