Commit 3dbfab9b authored by Thierry Geraud's avatar Thierry Geraud
Browse files

2006-10-17 Thierry GERAUD <theo@tegucigalpa.lrde.epita.fr>

	Add forward declaration files.
	
	* oln/core/aliases.hh: New.
	* oln/core/fwd_decls.hh: New.
	* oln/core/1d/fwd_decls.hh: New.
	* oln/core/2d/fwd_decls.hh: New.
	* oln/core/3d/fwd_decls.hh: New.
	* oln/core/gen/fwd_decls.hh: New.
	* oln/morpher/fwd_decls.hh: New.
	* oln/debug/typename.hh: New.
	* oln/Makefile.am: Update.
	
	Sketch the mechanism for 'plain' and 'ch_value'.

	* oln/core/type_fun/plain.hh: New.
	* oln/core/type_fun/ch_value.hh: New.
	* oln/core/typedefs.hh (oln_plain, oln_plain_): New.
	* oln/core/image_entry.hh (concrete_type): Remove; obsolete.
	* oln/core/abstract/image.hh
	(topo, operator): Change sigs.
	(topo_t, psite_t, rvalue_t): Remove; now unused.
	(decl): Uncomment static checks.
	* oln/core/abstract/image/computability/hierarchy.hh
	(plain): New.
	* oln/core/1d/image1d.hh (real_type): Remove; obsolete.
	* oln/core/2d/image2d.hh: Likewise.
	* oln/core/3d/image3d.hh: Likewise.
	* oln/morpher/value_cast.hh (class): Change into struct
	for homogeneity for other morphers.



git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@656 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent adab9e11
2006-10-17 Thierry GERAUD <theo@tegucigalpa.lrde.epita.fr>
Add forward declaration files.
* oln/core/aliases.hh: New.
* oln/core/fwd_decls.hh: New.
* oln/core/1d/fwd_decls.hh: New.
* oln/core/2d/fwd_decls.hh: New.
* oln/core/3d/fwd_decls.hh: New.
* oln/core/gen/fwd_decls.hh: New.
* oln/morpher/fwd_decls.hh: New.
* oln/debug/typename.hh: New.
* oln/Makefile.am: Update.
Sketch the mechanism for 'plain' and 'ch_value'.
* oln/core/type_fun/plain.hh: New.
* oln/core/type_fun/ch_value.hh: New.
* oln/core/typedefs.hh (oln_plain, oln_plain_): New.
* oln/core/image_entry.hh (concrete_type): Remove; obsolete.
* oln/core/abstract/image.hh
(topo, operator): Change sigs.
(topo_t, psite_t, rvalue_t): Remove; now unused.
(decl): Uncomment static checks.
* oln/core/abstract/image/computability/hierarchy.hh
(plain): New.
* oln/core/1d/image1d.hh (real_type): Remove; obsolete.
* oln/core/2d/image2d.hh: Likewise.
* oln/core/3d/image3d.hh: Likewise.
* oln/morpher/value_cast.hh (class): Change into struct
for homogeneity for other morphers.
2006-10-17 Roland Levillain <roland@lrde.epita.fr>
Organize the tests into a hierarchy.
......
......@@ -8,6 +8,7 @@ nobase_oln_HEADERS = \
core/1d/aliases.hh \
core/1d/array1d.hh \
core/1d/dpoint1d.hh \
core/1d/fwd_decls.hh \
core/1d/image1d.hh \
core/1d/neighb1d.hh \
core/1d/point1d.hh \
......@@ -15,6 +16,7 @@ nobase_oln_HEADERS = \
core/2d/aliases.hh \
core/2d/array2d.hh \
core/2d/dpoint2d.hh \
core/2d/fwd_decls.hh \
core/2d/image2d.hh \
core/2d/neighb2d.hh \
core/2d/point2d.hh \
......@@ -22,6 +24,7 @@ nobase_oln_HEADERS = \
core/3d/aliases.hh \
core/3d/array3d.hh \
core/3d/dpoint3d.hh \
core/3d/fwd_decls.hh \
core/3d/image3d.hh \
core/3d/neighb3d.hh \
core/3d/point3d.hh \
......@@ -104,6 +107,7 @@ nobase_oln_HEADERS = \
core/gen/bkd_niter_neighb.hh \
core/gen/bkd_piter_bbox.hh \
core/gen/bkd_qiter_win.hh \
core/gen/fwd_decls.hh \
core/gen/fwd_niter_neighb.hh \
core/gen/fwd_piter_bbox.hh \
core/gen/fwd_qiter_win.hh \
......@@ -119,6 +123,9 @@ nobase_oln_HEADERS = \
core/spe/row.hh \
core/spe/slice.hh \
\
core/type_fun/ch_value.hh \
core/type_fun/plain.hh \
\
core/internal/bbox_bkd_piter.hh \
core/internal/bbox_fwd_piter.hh \
core/internal/dpoint_nd.hh \
......@@ -126,7 +133,9 @@ nobase_oln_HEADERS = \
core/internal/topology_morpher.hh \
core/internal/tracked_ptr.hh \
\
core/aliases.hh \
core/case.hh \
core/fwd_decls.hh \
core/image_entry.hh \
core/iterator_vtypes.hh \
core/macros.hh \
......@@ -139,6 +148,7 @@ nobase_oln_HEADERS = \
core/type.hh \
\
debug/print.hh \
debug/typename.hh \
\
io/pnm.hh \
\
......@@ -148,6 +158,7 @@ nobase_oln_HEADERS = \
morpher/internal/image_value_morpher.hh \
\
morpher/add_neighborhood.hh \
morpher/fwd_decls.hh \
morpher/identity.hh \
morpher/tags.hh \
morpher/thru_fun.hh \
......
// Copyright (C) 2006 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 OLN_CORE_1D_FWD_DECLS
# define OLN_CORE_1D_FWD_DECLS
namespace oln
{
template <typename V, typename C> class array1d;
template <typename C> class dpoint1d_;
template <typename C> class point1d_;
template <typename T> class image1d;
} // end of namespace oln
#endif // ! OLN_CORE_1D_FWD_DECLS
......@@ -61,8 +61,6 @@ namespace oln
typedef mlc::false_ is_computed_type;
typedef T value_type;
typedef T& lvalue_type;
typedef image1d<T> real_type;
};
......
// Copyright (C) 2006 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 OLN_CORE_2D_FWD_DECLS
# define OLN_CORE_2D_FWD_DECLS
namespace oln
{
template <typename V, typename C> class array2d;
template <typename C> class dpoint2d_;
template <typename C> class point2d_;
template <typename T> class image2d;
} // end of namespace oln
#endif // ! OLN_CORE_2D_FWD_DECLS
......@@ -61,8 +61,6 @@ namespace oln
typedef mlc::false_ is_computed_type;
typedef T value_type;
typedef T& lvalue_type;
typedef image2d<T> real_type;
};
......
// Copyright (C) 2006 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 OLN_CORE_3D_FWD_DECLS
# define OLN_CORE_3D_FWD_DECLS
namespace oln
{
template <typename V, typename C> class array3d;
template <typename C> class dpoint3d_;
template <typename C> class point3d_;
template <typename T> class image3d;
} // end of namespace oln
#endif // ! OLN_CORE_3D_FWD_DECLS
......@@ -61,8 +61,6 @@ namespace oln
typedef mlc::false_ is_computed_type;
typedef T value_type;
typedef T& lvalue_type;
typedef image3d<T> real_type;
};
......
......@@ -63,39 +63,24 @@ namespace oln
struct decl
{
// oln_virtual_typedef(topo);
// oln_virtual_typedef(grid);
oln_virtual_typedef(topo);
oln_virtual_typedef(grid);
oln_virtual_typedef(coord);
oln_virtual_typedef(psite);
oln_virtual_typedef(point);
// oln_virtual_typedef(coord);
// oln_virtual_typedef(psite);
// oln_virtual_typedef(point);
// // oln_virtual_typedef(piter);
// // oln_virtual_typedef(fwd_piter);
// // oln_virtual_typedef(bkd_piter);
oln_virtual_typedef(fwd_piter);
oln_virtual_typedef(bkd_piter);
oln_virtual_typedef(is_computed);
oln_virtual_typedef(value);
oln_virtual_typedef(rvalue);
// oln_virtual_typedef(value);
// oln_virtual_typedef(rvalue);
// oln_virtual_typedef(concrete);
// oln_virtual_typedef(morpher);
oln_virtual_typedef(morpher);
decl();
};
private:
/// Typedefs.
typedef oln_type_of(E, topo) topo_t;
typedef oln_type_of(E, psite) psite_t;
typedef oln_type_of(E, rvalue) rvalue_t;
public:
/*------------------*
......@@ -111,14 +96,14 @@ namespace oln
** topo2d.
*/
const topo_t& topo() const;
const oln_topo(E)& topo() const;
/*! \brief Gives access to the value stored at \a p in the
** current image.
*/
rvalue_t operator()(const psite_t& p) const;
oln_rvalue(E) operator()(const oln_psite(E)& p) const;
protected:
......@@ -138,13 +123,14 @@ namespace oln
template <typename E>
image<E>::decl::decl()
{
// mlc::assert_< mlc_is_a(topo, abstract::topology) >::check();
// mlc::assert_< mlc_is_a(grid, abstract::grid) >::check();
// mlc::assert_< mlc_is_a(piter, abstract::iterator_on_points) >::check();
// mlc::assert_< mlc_is_a(fwd_piter, abstract::iterator_on_points) >::check();
// mlc::assert_< mlc_is_a(bkd_piter, abstract::iterator_on_points) >::check();
mlc::assert_< mlc_is_a(topo, abstract::topology) >::check();
mlc::assert_< mlc_is_a(grid, abstract::grid) >::check();
mlc::assert_< mlc_is_a(point, abstract::point) >::check();
mlc::assert_< mlc_is_a(fwd_piter, abstract::iterator_on_points) >::check();
mlc::assert_< mlc_is_a(bkd_piter, abstract::iterator_on_points) >::check();
// FIXME: Rec.
// mlc::assert_< mlc_is_a(concrete, abstract::image) >::check();
// mlc::assert_< mlc_is_a(plain, abstract::image) >::check();
}
template <typename E>
......@@ -159,15 +145,15 @@ namespace oln
}
template <typename E>
const typename image<E>::topo_t&
const oln_topo(E)&
image<E>::topo() const
{
return this->exact().impl_topo();
}
template <typename E>
typename image<E>::rvalue_t
image<E>::operator()(const typename image<E>::psite_t& p) const
oln_rvalue(E)
image<E>::operator()(const oln_psite(E)& p) const
{
return this->exact().impl_op_read(p);
}
......
......@@ -50,6 +50,10 @@ namespace oln
struct computed_image :
public virtual image<E> //, public automatic::get_impl< computed_image, E>
{
public:
oln_plain(E) plain() const;
protected:
/// Constructor (protected, empty).
......@@ -76,6 +80,14 @@ namespace oln
{
}
template <typename E>
oln_plain(E)
computed_image<E>::plain() const
{
oln_plain(E) tmp(this->topo());
return tmp;
}
template <typename E>
plain_image<E>::plain_image()
{
......
// Copyright (C) 2001, 2003, 2004, 2005, 2006 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 OLN_CORE_ALIASES_HH
# define OLN_CORE_ALIASES_HH
# include <oln/core/1d/aliases.hh>
# include <oln/core/2d/aliases.hh>
# include <oln/core/3d/aliases.hh>
#endif // ! OLN_CORE_ALIASES_HH
// Copyright (C) 2006 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 OLN_CORE_FWD_DECLS
# define OLN_CORE_FWD_DECLS
# include <oln/core/1d/fwd_decls.hh>
# include <oln/core/2d/fwd_decls.hh>
# include <oln/core/3d/fwd_decls.hh>
# include <oln/core/gen/fwd_decls.hh>
namespace oln
{
template <typename T> class image1d;
template <typename T> class image2d;
template <typename T> class image3d;
template <typename E> class image_entry;
template <typename E> class image_entry;
template <typename P, typename V> class mapimage;
} // end of namespace oln
#endif // ! OLN_CORE_FWD_DECLS
// Copyright (C) 2006 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 OLN_CORE_GEN_FWD_DECLS
# define OLN_CORE_GEN_FWD_DECLS
namespace oln
{
template <unsigned D> struct grid_;
template <typename P> class bbox_;
template <typename P> class bbox_fwd_piter_;
template <typename P> class bbox_bkd_piter_;
template <typename P> class fwd_piter_bbox_;
template <typename P> class bkd_piter_bbox_;
template <typename D> class window_;
template <typename P> class fwd_qiter_win_;
template <typename P> class bkd_qiter_win_;
template <typename D> class neighb_;
template <typename P> class fwd_niter_neighb_;
template <typename P> class bkd_niter_neighb_;
template <typename P> class topo_bbox_;
template <typename P> class topo_lbbox_;
template <typename topo, typename isubset> class topo_add_isubset;
template <typename topo, typename nbh> class topo_add_nbh;
template <typename P, typename V> class mapimage;
} // end of namespace oln
#endif // ! OLN_CORE_GEN_FWD_DECLS
......@@ -31,6 +31,8 @@
# include <oln/core/abstract/entry.hh>
# include <oln/core/abstract/image/all.hh>
# include <oln/core/type_fun/plain.hh>
namespace oln
......@@ -84,8 +86,6 @@ namespace oln
// fwd_qiter_type: see below.
// bkd_qiter_type: see below.
typedef mlc::undefined concrete_type;
/// \brief Morpher type.
///
/// Optionally contains a tag indicating a kind of morpher.
......
// Copyright (C) 2006 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 OLN_CORE_TYPE_FUN_CH_VALUE_HH
# define OLN_CORE_TYPE_FUN_CH_VALUE_HH
# include <mlc/flags.hh>
# include <oln/core/fwd_decls.hh>
# include <oln/morpher/fwd_decls.hh>
namespace oln
{
namespace type_fun
{
template <typename Image, typename Value>
struct ch_value
{
typedef mlc::undefined ret;
};
// image?d
template <typename T, typename Value>
struct ch_value< image1d<T>, Value >
{
typedef image1d<Value> ret;