
2006-09-18 Thierry GERAUD <theo@tegucigalpa.lrde.epita.fr> Rename point set related classes. * oln/core/pset_entry.hh: Update and rename as... * oln/core/point_set_entry.hh: ...this. * oln/core/abstract/pset_fixed.hh: Update and rename as... * oln/core/abstract/point_set_having_known_size.hh: ...this. * oln/core/abstract/pset_ra.hh: Update and rename as... * oln/core/abstract/point_set_being_random_accessible.hh: ...this. * oln/core/abstract/pset_bboxed.hh: Update and rename as... * oln/core/abstract/point_set_having_bbox.hh: ...this. * oln/core/abstract/pset.hh: Update and rename as... * oln/core/abstract/point_set.hh: ...this. * oln/core/abstract/pset_hierarchies.hh: Update and rename as... * oln/core/abstract/point_set_hierarchies.hh: ...this. * oln/core/abstract/pset_cnx.hh: Update and rename as... * oln/core/abstract/point_set_being_connected.hh: ...this. * oln/core/abstract/piter.hh: Update and rename as... * oln/core/abstract/iterator_on_points.hh: ...this. * oln/core/abstract/iter.hh: Update and rename as... * oln/core/abstract/iterator.hh: ...this. * oln/core/typedefs.hh (fixed_type, ra_type, cnx_type): Rename as... (has_known_size_type, is_random_accessible_type): ...these and... (is_connected_type): ....this. * oln/core/abstract/bbox.hh: Update. * oln/core/gen/fwd_piter.hh: Update. * oln/core/gen/bkd_piter.hh: Update. Index: oln/core/typedefs.hh =================================================================== --- oln/core/typedefs.hh (revision 548) +++ oln/core/typedefs.hh (working copy) @@ -99,14 +99,13 @@ // -------------------------------------------------------------------- - /*-----------------. - | category::pset. | - `------------------*/ + /*----------------------. + | category::point_set. | + `-----------------------*/ - mlc_decl_typedef(fixed_type); - mlc_decl_typedef(ra_type); + mlc_decl_typedef(has_known_size_type); mlc_decl_typedef(is_random_accessible_type); - mlc_decl_typedef(cnx_type); + mlc_decl_typedef(is_connected_type); /*------------------. Index: oln/core/point_set_entry.hh =================================================================== --- oln/core/point_set_entry.hh (revision 547) +++ oln/core/point_set_entry.hh (working copy) @@ -25,11 +25,11 @@ // reasons why the executable file might be covered by the GNU General // Public License. -#ifndef OLENA_CORE_PSET_ENTRY_HH -# define OLENA_CORE_PSET_ENTRY_HH +#ifndef OLENA_CORE_POINT_SET_ENTRY_HH +# define OLENA_CORE_POINT_SET_ENTRY_HH # include <oln/core/abstract/entry.hh> -# include <oln/core/abstract/pset.hh> +# include <oln/core/abstract/point_set.hh> @@ -37,21 +37,21 @@ { - /// Entry class for point sets: pset_entry<E> is an alias for - /// entry< abstract::pset, E>. + /// Entry class for point sets: point_set_entry<E> is an alias for + /// entry< abstract::point_set, E>. template <typename E> - struct pset_entry : public entry< abstract::pset, E> + struct point_set_entry : public entry< abstract::point_set, E> { protected: - pset_entry() {} + point_set_entry() {} }; - /// Virtual types associated to pset_entry<E>. + /// Virtual types associated to point_set_entry<E>. template <typename E> - struct vtypes< pset_entry<E> > + struct vtypes< point_set_entry<E> > { typedef mlc::undefined point_type; @@ -60,13 +60,13 @@ typedef mlc::undefined bkd_piter_type; typedef mlc::none bbox_type; - typedef mlc::undefined ra_type; - typedef mlc::undefined fixed_type; + typedef mlc::undefined is_random_accessible_type; + typedef mlc::undefined has_known_size_type; }; template <typename E> - struct single_vtype< pset_entry<E>, typedef_::coord_type > + struct single_vtype< point_set_entry<E>, typedef_::coord_type > { typedef oln_type_of(E, point) P; typedef oln_type_of(P, coord) ret; @@ -74,7 +74,7 @@ template <typename E> - struct single_vtype< pset_entry<E>, typedef_::grid_type > + struct single_vtype< point_set_entry<E>, typedef_::grid_type > { typedef oln_type_of(E, point) P; typedef oln_type_of(P, grid) ret; @@ -82,7 +82,7 @@ template <typename E> - struct single_vtype< pset_entry<E>, typedef_::dim_type > + struct single_vtype< point_set_entry<E>, typedef_::dim_type > { typedef oln_type_of(E, point) P; typedef oln_type_of(P, dim) ret; @@ -90,7 +90,7 @@ template <typename E> - struct single_vtype< pset_entry<E>, typedef_::piter_type > + struct single_vtype< point_set_entry<E>, typedef_::piter_type > { typedef oln_type_of(E, fwd_piter) ret; }; @@ -99,4 +99,4 @@ } // end of namespace oln -#endif // ! OLENA_CORE_PSET_ENTRY_HH +#endif // ! OLENA_CORE_POINT_SET_ENTRY_HH Index: oln/core/pset_entry.hh =================================================================== --- oln/core/pset_entry.hh (revision 548) +++ oln/core/pset_entry.hh (working copy) @@ -1,102 +0,0 @@ -// 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 OLENA_CORE_PSET_ENTRY_HH -# define OLENA_CORE_PSET_ENTRY_HH - -# include <oln/core/abstract/entry.hh> -# include <oln/core/abstract/pset.hh> - - - -namespace oln -{ - - - /// Entry class for point sets: pset_entry<E> is an alias for - /// entry< abstract::pset, E>. - - template <typename E> - struct pset_entry : public entry< abstract::pset, E> - { - protected: - pset_entry() {} - }; - - - /// Virtual types associated to pset_entry<E>. - - template <typename E> - struct vtypes< pset_entry<E> > - { - typedef mlc::undefined point_type; - - typedef mlc::undefined piter_type; - typedef mlc::undefined fwd_piter_type; - typedef mlc::undefined bkd_piter_type; - - typedef mlc::none bbox_type; - typedef mlc::undefined ra_type; - typedef mlc::undefined fixed_type; - }; - - - template <typename E> - struct single_vtype< pset_entry<E>, typedef_::coord_type > - { - typedef oln_type_of(E, point) P; - typedef oln_type_of(P, coord) ret; - }; - - - template <typename E> - struct single_vtype< pset_entry<E>, typedef_::grid_type > - { - typedef oln_type_of(E, point) P; - typedef oln_type_of(P, grid) ret; - }; - - - template <typename E> - struct single_vtype< pset_entry<E>, typedef_::dim_type > - { - typedef oln_type_of(E, point) P; - typedef oln_type_of(P, dim) ret; - }; - - - template <typename E> - struct single_vtype< pset_entry<E>, typedef_::piter_type > - { - typedef oln_type_of(E, fwd_piter) ret; - }; - - -} // end of namespace oln - - -#endif // ! OLENA_CORE_PSET_ENTRY_HH Index: oln/core/abstract/point_set_being_random_accessible.hh =================================================================== --- oln/core/abstract/point_set_being_random_accessible.hh (revision 547) +++ oln/core/abstract/point_set_being_random_accessible.hh (working copy) @@ -25,10 +25,10 @@ // reasons why the executable file might be covered by the GNU General // Public License. -#ifndef OLENA_CORE_ABSTRACT_PSET_RA_HH -# define OLENA_CORE_ABSTRACT_PSET_RA_HH +#ifndef OLENA_CORE_ABSTRACT_POINT_SET_BEING_RANDOM_ACCESSIBLE_HH +# define OLENA_CORE_ABSTRACT_POINT_SET_BEING_RANDOM_ACCESSIBLE_HH -# include <oln/core/abstract/pset.hh> +# include <oln/core/abstract/point_set.hh> @@ -40,7 +40,7 @@ template <typename E> - class ra_pset : public virtual pset<E> + class point_set_being_random_accessible : public virtual point_set<E> { typedef oln_type_of(E, point) point_t; @@ -52,7 +52,7 @@ } protected: - ra_pset() + point_set_being_random_accessible() {} }; @@ -61,14 +61,14 @@ template <typename E> - struct case_ < pset_ra_hierarchy, E, 1 > - : where_< mlc::eq_< oln_type_of(E, ra), mlc::true_ > > + struct case_ < point_set_hierarchy_wrt_accessibility, E, 1 > + : where_< mlc::eq_< oln_type_of(E, is_random_accessible), mlc::true_ > > { - typedef abstract::ra_pset<E> ret; + typedef abstract::point_set_being_random_accessible<E> ret; }; } // end of namespace oln -#endif // ! OLENA_CORE_ABSTRACT_PSET_RA_HH +#endif // ! OLENA_CORE_ABSTRACT_POINT_SET_BEING_RANDOM_ACCESSIBLE_HH Index: oln/core/abstract/pset_fixed.hh =================================================================== --- oln/core/abstract/pset_fixed.hh (revision 548) +++ oln/core/abstract/pset_fixed.hh (working copy) @@ -1,73 +0,0 @@ -// 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 OLENA_CORE_ABSTRACT_PSET_FIXED_HH -# define OLENA_CORE_ABSTRACT_PSET_FIXED_HH - -# include <oln/core/abstract/pset.hh> - - - -namespace oln -{ - - namespace abstract - { - - - template <typename E> - class fixed_pset : public virtual pset<E> - { - public: - - unsigned npoints() const - { - return this->exact().impl_npoints(); - } - - protected: - fixed_pset() - {} - }; - - - } // end of namespace oln::abstract - - - template <typename E> - struct case_ < pset_fixed_hierarchy, E, 1 > - : where_< mlc::eq_< oln_type_of(E, fixed), mlc::true_ > > - { - typedef abstract::fixed_pset<E> ret; - }; - - -} // end of namespace oln - - -#endif // ! OLENA_CORE_ABSTRACT_PSET_FIXED_HH - Index: oln/core/abstract/point_set_being_connected.hh =================================================================== --- oln/core/abstract/point_set_being_connected.hh (revision 547) +++ oln/core/abstract/point_set_being_connected.hh (working copy) @@ -25,10 +25,10 @@ // reasons why the executable file might be covered by the GNU General // Public License. -#ifndef OLENA_CORE_ABSTRACT_PSET_CNX_HH -# define OLENA_CORE_ABSTRACT_PSET_CNX_HH +#ifndef OLENA_CORE_ABSTRACT_POINT_SET_BEING_CONNECTED_HH +# define OLENA_CORE_ABSTRACT_POINT_SET_BEING_CONNECTED_HH -# include <oln/core/abstract/pset.hh> +# include <oln/core/abstract/point_set.hh> namespace oln @@ -39,7 +39,7 @@ template <typename E> - class cnx2d_pset : public virtual abstract::pset<E> + class point_set_being_2d_connected : public virtual abstract::point_set<E> { public: @@ -57,7 +57,7 @@ protected: - cnx2d_pset() + point_set_being_2d_connected() {} }; @@ -67,17 +67,16 @@ template <typename E> - struct case_ < pset_cnx_hierarchy, E, 1 > + struct case_ < point_set_hierarchy_wrt_connectivity, E, 1 > : where_< mlc::and_list_< mlc::neq_< oln_type_of(E, bbox), mlc::none >, - mlc::eq_< oln_type_of(E, cnx), mlc::true_ >, + mlc::eq_< oln_type_of(E, is_connected), mlc::true_ >, mlc::eq_< oln_type_of(E, grid), grid2d > > > { - typedef abstract::cnx2d_pset<E> ret; + typedef abstract::point_set_being_2d_connected<E> ret; }; } // end of namespace oln -#endif // ! OLENA_CORE_ABSTRACT_PSET_CNX_HH - +#endif // ! OLENA_CORE_ABSTRACT_POINT_SET_BEING_CONNECTED_HH Index: oln/core/abstract/pset_ra.hh =================================================================== --- oln/core/abstract/pset_ra.hh (revision 548) +++ oln/core/abstract/pset_ra.hh (working copy) @@ -1,74 +0,0 @@ -// 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 OLENA_CORE_ABSTRACT_PSET_RA_HH -# define OLENA_CORE_ABSTRACT_PSET_RA_HH - -# include <oln/core/abstract/pset.hh> - - - -namespace oln -{ - - namespace abstract - { - - - template <typename E> - class ra_pset : public virtual pset<E> - { - typedef oln_type_of(E, point) point_t; - - public: - - bool has(const point_t& p) const - { - return this->exact().impl_has(p); - } - - protected: - ra_pset() - {} - }; - - - } // end of namespace oln::abstract - - - template <typename E> - struct case_ < pset_ra_hierarchy, E, 1 > - : where_< mlc::eq_< oln_type_of(E, ra), mlc::true_ > > - { - typedef abstract::ra_pset<E> ret; - }; - - -} // end of namespace oln - - -#endif // ! OLENA_CORE_ABSTRACT_PSET_RA_HH Index: oln/core/abstract/pset_bboxed.hh =================================================================== --- oln/core/abstract/pset_bboxed.hh (revision 548) +++ oln/core/abstract/pset_bboxed.hh (working copy) @@ -1,111 +0,0 @@ -// 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 OLENA_CORE_ABSTRACT_PSET_BBOXED_HH -# define OLENA_CORE_ABSTRACT_PSET_BBOXED_HH - -# include <oln/core/abstract/pset.hh> - - -namespace oln -{ - - namespace abstract - { - - - template <typename E> - class bboxed_pset : public virtual pset<E> - { - typedef oln_type_of(E, point) point_t; - typedef oln_type_of(E, bbox) bbox_t; - - typedef oln_type_of(point_t, coord) coord_t; - typedef oln_type_of(point_t, dim) dim_t; - enum { n = mlc_value(dim_t) }; - - public: - - const bbox_t& bbox() const - { - return this->exact().impl_box(); - } - - const point_t& pmin() const - { - precondition(this->is_valid()); - return pmin_; - } - - coord_t pmin(unsigned i) const - { - precondition(this->is_valid() and i < n); - return pmin_[i]; - } - - const point_t& pmax() const - { - precondition(this->is_valid()); - return pmax_; - } - - coord_t pmax(unsigned i) const - { - precondition(this->is_valid() and i < n); - return pmax_[i]; - } - - unsigned len(unsigned i) const - { - precondition(this->is_valid() and i < n); - return pmax_[i] - pmin_[i] + 1; - } - - protected: - - bboxed_pset() - {} - - point_t pmin_, pmax_; - }; - - - } // end of namespace oln::abstract - - - template <typename E> - struct case_ < pset_bboxed_hierarchy, E, 1 > - : where_< mlc::neq_< oln_type_of(E, bbox), mlc::none > > - { - typedef abstract::bboxed_pset<E> ret; - }; - - -} // end of namespace oln - - -#endif // ! OLENA_CORE_ABSTRACT_PSET_BBOXED_HH Index: oln/core/abstract/point_set.hh =================================================================== --- oln/core/abstract/point_set.hh (revision 547) +++ oln/core/abstract/point_set.hh (working copy) @@ -25,8 +25,8 @@ // reasons why the executable file might be covered by the GNU General // Public License. -#ifndef OLENA_CORE_ABSTRACT_PSET_HH -# define OLENA_CORE_ABSTRACT_PSET_HH +#ifndef OLENA_CORE_ABSTRACT_POINT_SET_HH +# define OLENA_CORE_ABSTRACT_POINT_SET_HH # include <oln/core/typedefs.hh> @@ -40,8 +40,8 @@ /// Abstract point class. template <typename E> - class pset : public virtual stc::any__simple<E>, - public virtual oln::type + class point_set : public virtual stc::any__simple<E>, + public virtual oln::type { public: @@ -58,10 +58,10 @@ stc_virtual_typedef(fwd_piter); stc_virtual_typedef(bkd_piter); - stc_virtual_typedef(bbox); // for being bboxed; provides .bbox() - stc_virtual_typedef(ra); // for random access; provides .has(p) - stc_virtual_typedef(fixed); // for fixed size; provides .npoints() - stc_virtual_typedef(cnx); // for connected; provides, e.g., .nrows() + stc_virtual_typedef(bbox); // provides .bbox() + stc_virtual_typedef(is_random_accessible); // provides .has(p) + stc_virtual_typedef(has_known_size); // provides .npoints() + stc_virtual_typedef(is_connected); // provides, e.g., .nrows() // derived from point: stc_virtual_typedef(coord); @@ -79,12 +79,12 @@ protected: - pset() + point_set() {} - ~pset() { decl(); } + ~point_set() { decl(); } - }; // end of class oln::abstract::pset<E> + }; // end of class oln::abstract::point_set<E> @@ -94,8 +94,8 @@ -# include <oln/core/abstract/pset_hierarchies.hh> +# include <oln/core/abstract/point_set_hierarchies.hh> -#endif // ! OLENA_CORE_ABSTRACT_PSET_HH +#endif // ! OLENA_CORE_ABSTRACT_POINT_SET_HH Index: oln/core/abstract/point_set_having_bbox.hh =================================================================== --- oln/core/abstract/point_set_having_bbox.hh (revision 547) +++ oln/core/abstract/point_set_having_bbox.hh (working copy) @@ -25,10 +25,10 @@ // reasons why the executable file might be covered by the GNU General // Public License. -#ifndef OLENA_CORE_ABSTRACT_PSET_BBOXED_HH -# define OLENA_CORE_ABSTRACT_PSET_BBOXED_HH +#ifndef OLENA_CORE_ABSTRACT_POINT_SET_HAVING_BBOX_HH +# define OLENA_CORE_ABSTRACT_POINT_SET_HAVING_BBOX_HH -# include <oln/core/abstract/pset.hh> +# include <oln/core/abstract/point_set.hh> namespace oln @@ -39,7 +39,7 @@ template <typename E> - class bboxed_pset : public virtual pset<E> + class point_set_having_bbox : public virtual point_set<E> { typedef oln_type_of(E, point) point_t; typedef oln_type_of(E, bbox) bbox_t; @@ -87,7 +87,7 @@ protected: - bboxed_pset() + point_set_having_bbox() {} point_t pmin_, pmax_; @@ -98,14 +98,14 @@ template <typename E> - struct case_ < pset_bboxed_hierarchy, E, 1 > + struct case_ < point_set_hierarchy_wrt_bbox, E, 1 > : where_< mlc::neq_< oln_type_of(E, bbox), mlc::none > > { - typedef abstract::bboxed_pset<E> ret; + typedef abstract::point_set_having_bbox<E> ret; }; } // end of namespace oln -#endif // ! OLENA_CORE_ABSTRACT_PSET_BBOXED_HH +#endif // ! OLENA_CORE_ABSTRACT_POINT_SET_HAVING_BBOX_HH Index: oln/core/abstract/point_set_hierarchies.hh =================================================================== --- oln/core/abstract/point_set_hierarchies.hh (revision 547) +++ oln/core/abstract/point_set_hierarchies.hh (working copy) @@ -25,29 +25,29 @@ // reasons why the executable file might be covered by the GNU General // Public License. -#ifndef OLENA_CORE_ABSTRACT_PSET_HIERARCHIES_HH -# define OLENA_CORE_ABSTRACT_PSET_HIERARCHIES_HH +#ifndef OLENA_CORE_ABSTRACT_POINT_SET_HIERARCHIES_HH +# define OLENA_CORE_ABSTRACT_POINT_SET_HIERARCHIES_HH -# include <oln/core/abstract/pset.hh> +# include <oln/core/abstract/point_set.hh> namespace oln { - typedef hierarchy< abstract::pset, 1 > pset_fixed_hierarchy; - typedef hierarchy< abstract::pset, 2 > pset_ra_hierarchy; - typedef hierarchy< abstract::pset, 3 > pset_bboxed_hierarchy; - typedef hierarchy< abstract::pset, 4 > pset_cnx_hierarchy; + typedef hierarchy< abstract::point_set, 1 > point_set_hierarchy_wrt_known_size; + typedef hierarchy< abstract::point_set, 2 > point_set_hierarchy_wrt_accessibility; + typedef hierarchy< abstract::point_set, 3 > point_set_hierarchy_wrt_bbox; + typedef hierarchy< abstract::point_set, 4 > point_set_hierarchy_wrt_connectivity; } // end of namespace oln -# include <oln/core/abstract/pset_fixed.hh> -# include <oln/core/abstract/pset_ra.hh> -# include <oln/core/abstract/pset_bboxed.hh> -# include <oln/core/abstract/pset_cnx.hh> +# include <oln/core/abstract/point_set_having_known_size.hh> +# include <oln/core/abstract/point_set_being_random_accessible.hh> +# include <oln/core/abstract/point_set_having_bbox.hh> +# include <oln/core/abstract/point_set_being_connected.hh> -#endif // ! OLENA_CORE_ABSTRACT_PSET_HIERARCHIES_HH +#endif // ! OLENA_CORE_ABSTRACT_POINT_SET_HIERARCHIES_HH Index: oln/core/abstract/pset.hh =================================================================== --- oln/core/abstract/pset.hh (revision 548) +++ oln/core/abstract/pset.hh (working copy) @@ -1,101 +0,0 @@ -// 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 OLENA_CORE_ABSTRACT_PSET_HH -# define OLENA_CORE_ABSTRACT_PSET_HH - -# include <oln/core/typedefs.hh> - - -namespace oln -{ - - namespace abstract - { - - - /// Abstract point class. - template <typename E> - class pset : public virtual stc::any__simple<E>, - public virtual oln::type - { - public: - - bool is_valid() const - { - return this->exact().impl_is_valid(); - } - - struct decl - { - stc_virtual_typedef(point); - - stc_virtual_typedef(piter); - stc_virtual_typedef(fwd_piter); - stc_virtual_typedef(bkd_piter); - - stc_virtual_typedef(bbox); // for being bboxed; provides .bbox() - stc_virtual_typedef(ra); // for random access; provides .has(p) - stc_virtual_typedef(fixed); // for fixed size; provides .npoints() - stc_virtual_typedef(cnx); // for connected; provides, e.g., .nrows() - - // derived from point: - stc_virtual_typedef(coord); - stc_virtual_typedef(grid); - stc_virtual_typedef(dim); - - decl() { - // coherence check: - mlc::assert_equal_< oln_type_of(fwd_piter, grid), - oln_type_of(point, grid) >::check(); - mlc::assert_equal_< oln_type_of(bkd_piter, grid), - oln_type_of(point, grid) >::check(); - } - }; - - protected: - - pset() - {} - - ~pset() { decl(); } - - }; // end of class oln::abstract::pset<E> - - - - } // end of namespace oln::abstract - -} // end of namespace oln - - - -# include <oln/core/abstract/pset_hierarchies.hh> - - - -#endif // ! OLENA_CORE_ABSTRACT_PSET_HH Index: oln/core/abstract/iterator_on_points.hh =================================================================== --- oln/core/abstract/iterator_on_points.hh (revision 547) +++ oln/core/abstract/iterator_on_points.hh (working copy) @@ -26,10 +26,10 @@ // reasons why the executable file might be covered by the GNU General // Public License. -#ifndef OLENA_CORE_ABSTRACT_PITER_HH -# define OLENA_CORE_ABSTRACT_PITER_HH +#ifndef OLENA_CORE_ABSTRACT_ITERATOR_ON_POINTS_HH +# define OLENA_CORE_ABSTRACT_ITERATOR_ON_POINTS_HH -# include <oln/core/abstract/iter.hh> +# include <oln/core/abstract/iterator.hh> # include <oln/core/abstract/point.hh> @@ -38,20 +38,20 @@ // Forward declaration. - namespace abstract { template <typename E> class piter; } + namespace abstract { template <typename E> class iterator_on_points; } // Super type declaration. template <typename E> - struct set_super_type< abstract::piter<E> > + struct set_super_type< abstract::iterator_on_points<E> > { - typedef abstract::iter<E> ret; + typedef abstract::iterator<E> ret; }; - /// Virtual types associated to abstract::piter<E>. + /// Virtual types associated to abstract::iterator_on_points<E>. template <typename E> - struct vtypes< abstract::piter<E> > + struct vtypes< abstract::iterator_on_points<E> > { typedef mlc::undefined point_type; }; @@ -62,7 +62,7 @@ /// Abstract point iterator class. template <typename E> - class piter : public abstract::iter<E> + class iterator_on_points : public abstract::iterator<E> { typedef oln_type_of(E, point) point_t; @@ -84,17 +84,17 @@ point_t p_; - piter() + iterator_on_points() { } - ~piter() + ~iterator_on_points() { mlc::assert_defined_< point_t >::check(); mlc::assert_< mlc_is_a(point_t, abstract::point) >::check(); } - }; // end of class oln::abstract::piter<E> + }; // end of class oln::abstract::iterator_on_points<E> } // end of namespace oln::abstract @@ -103,4 +103,4 @@ } // end of namespace oln -#endif // ! OLENA_CORE_ABSTRACT_PITER_HH +#endif // ! OLENA_CORE_ABSTRACT_ITERATOR_ON_POINTS_HH Index: oln/core/abstract/pset_hierarchies.hh =================================================================== --- oln/core/abstract/pset_hierarchies.hh (revision 548) +++ oln/core/abstract/pset_hierarchies.hh (working copy) @@ -1,53 +0,0 @@ -// 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 OLENA_CORE_ABSTRACT_PSET_HIERARCHIES_HH -# define OLENA_CORE_ABSTRACT_PSET_HIERARCHIES_HH - -# include <oln/core/abstract/pset.hh> - - -namespace oln -{ - - typedef hierarchy< abstract::pset, 1 > pset_fixed_hierarchy; - typedef hierarchy< abstract::pset, 2 > pset_ra_hierarchy; - typedef hierarchy< abstract::pset, 3 > pset_bboxed_hierarchy; - typedef hierarchy< abstract::pset, 4 > pset_cnx_hierarchy; - -} // end of namespace oln - - -# include <oln/core/abstract/pset_fixed.hh> -# include <oln/core/abstract/pset_ra.hh> -# include <oln/core/abstract/pset_bboxed.hh> -# include <oln/core/abstract/pset_cnx.hh> - - - -#endif // ! OLENA_CORE_ABSTRACT_PSET_HIERARCHIES_HH - Index: oln/core/abstract/pset_cnx.hh =================================================================== --- oln/core/abstract/pset_cnx.hh (revision 548) +++ oln/core/abstract/pset_cnx.hh (working copy) @@ -1,83 +0,0 @@ -// 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 OLENA_CORE_ABSTRACT_PSET_CNX_HH -# define OLENA_CORE_ABSTRACT_PSET_CNX_HH - -# include <oln/core/abstract/pset.hh> - - -namespace oln -{ - - namespace abstract - { - - - template <typename E> - class cnx2d_pset : public virtual abstract::pset<E> - { - public: - - unsigned nrows() const - { - precondition(this->is_valid()); - return this->exact().len(0); - } - - unsigned ncols() const - { - precondition(this->is_valid()); - return this->exact().len(1); - } - - protected: - - cnx2d_pset() - {} - }; - - - } // end of namespace oln::abstract - - - - template <typename E> - struct case_ < pset_cnx_hierarchy, E, 1 > - : where_< mlc::and_list_< mlc::neq_< oln_type_of(E, bbox), mlc::none >, - mlc::eq_< oln_type_of(E, cnx), mlc::true_ >, - mlc::eq_< oln_type_of(E, grid), grid2d > > > - { - typedef abstract::cnx2d_pset<E> ret; - }; - - -} // end of namespace oln - - -#endif // ! OLENA_CORE_ABSTRACT_PSET_CNX_HH - Index: oln/core/abstract/piter.hh =================================================================== --- oln/core/abstract/piter.hh (revision 548) +++ oln/core/abstract/piter.hh (working copy) @@ -1,106 +0,0 @@ -// 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 OLENA_CORE_ABSTRACT_PITER_HH -# define OLENA_CORE_ABSTRACT_PITER_HH - -# include <oln/core/abstract/iter.hh> -# include <oln/core/abstract/point.hh> - - -namespace oln -{ - - - // Forward declaration. - namespace abstract { template <typename E> class piter; } - - - // Super type declaration. - template <typename E> - struct set_super_type< abstract::piter<E> > - { - typedef abstract::iter<E> ret; - }; - - - /// Virtual types associated to abstract::piter<E>. - template <typename E> - struct vtypes< abstract::piter<E> > - { - typedef mlc::undefined point_type; - }; - - - namespace abstract - { - - /// Abstract point iterator class. - template <typename E> - class piter : public abstract::iter<E> - { - typedef oln_type_of(E, point) point_t; - - public: - - operator point_t() const - { - precondition(this->is_valid()); - return p_; - } - - point_t to_point() const - { - precondition(this->is_valid()); - return p_; - } - - protected: - - point_t p_; - - piter() - { - } - - ~piter() - { - mlc::assert_defined_< point_t >::check(); - mlc::assert_< mlc_is_a(point_t, abstract::point) >::check(); - } - - }; // end of class oln::abstract::piter<E> - - - } // end of namespace oln::abstract - - -} // end of namespace oln - - -#endif // ! OLENA_CORE_ABSTRACT_PITER_HH Index: oln/core/abstract/iterator.hh =================================================================== --- oln/core/abstract/iterator.hh (revision 547) +++ oln/core/abstract/iterator.hh (working copy) @@ -26,8 +26,8 @@ // reasons why the executable file might be covered by the GNU General // Public License. -#ifndef OLENA_CORE_ABSTRACT_ITER_HH -# define OLENA_CORE_ABSTRACT_ITER_HH +#ifndef OLENA_CORE_ABSTRACT_ITERATOR_HH +# define OLENA_CORE_ABSTRACT_ITERATOR_HH # include <oln/core/typedefs.hh> @@ -41,8 +41,8 @@ /// Abstract iterator class. template <typename E> - class iter : public stc::any__best_memory<E>, - public oln::type + class iterator : public stc::any__best_memory<E>, + public oln::type { public: @@ -69,11 +69,11 @@ protected: - iter() + iterator() { } - }; // end of class oln::abstract::iter<E> + }; // end of class oln::abstract::iterator<E> } // end of namespace oln::abstract @@ -85,4 +85,4 @@ #define for_all(i) for (i.start(); i.is_valid(); i.next()) -#endif // ! OLENA_CORE_ABSTRACT_ITER_HH +#endif // ! OLENA_CORE_ABSTRACT_ITERATOR_HH Index: oln/core/abstract/bbox.hh =================================================================== --- oln/core/abstract/bbox.hh (revision 548) +++ oln/core/abstract/bbox.hh (working copy) @@ -29,7 +29,7 @@ #ifndef OLENA_CORE_ABSTRACT_BBOX_HH # define OLENA_CORE_ABSTRACT_BBOX_HH -# include <oln/core/pset_entry.hh> +# include <oln/core/point_set_entry.hh> namespace oln @@ -43,7 +43,7 @@ template <typename E> struct set_super_type< abstract::bbox<E> > { - typedef pset_entry<E> ret; + typedef point_set_entry<E> ret; }; @@ -51,9 +51,9 @@ template <typename E> struct vtypes< abstract::bbox<E> > { - typedef mlc::true_ ra_type; - typedef mlc::true_ fixed_type; - typedef mlc::true_ cnx_type; + typedef mlc::true_ is_random_accessible_type; + typedef mlc::true_ has_know_size_type; + typedef mlc::true_ is_connected_type; typedef E bbox_type; }; @@ -63,7 +63,7 @@ /// Abstract bbox (bounding box) class. template <typename E> - class bbox : public pset_entry<E> + class bbox : public point_set_entry<E> { typedef oln_type_of(E, point) point_t; Index: oln/core/abstract/iter.hh =================================================================== --- oln/core/abstract/iter.hh (revision 548) +++ oln/core/abstract/iter.hh (working copy) @@ -1,88 +0,0 @@ -// 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 OLENA_CORE_ABSTRACT_ITER_HH -# define OLENA_CORE_ABSTRACT_ITER_HH - -# include <oln/core/typedefs.hh> - - -namespace oln -{ - - - namespace abstract - { - - /// Abstract iterator class. - template <typename E> - class iter : public stc::any__best_memory<E>, - public oln::type - { - public: - - void start() - { - this->exact().impl_start(); - } - - void next() - { - precondition(this->is_valid()); - this->exact().impl_next(); - } - - void invalidate() - { - this->exact().impl_invalidate(); - } - - bool is_valid() const - { - return this->exact().impl_is_valid(); - } - - protected: - - iter() - { - } - - }; // end of class oln::abstract::iter<E> - - - } // end of namespace oln::abstract - - -} // end of namespace oln - - -#define for_all(i) for (i.start(); i.is_valid(); i.next()) - - -#endif // ! OLENA_CORE_ABSTRACT_ITER_HH Index: oln/core/abstract/point_set_having_known_size.hh =================================================================== --- oln/core/abstract/point_set_having_known_size.hh (revision 547) +++ oln/core/abstract/point_set_having_known_size.hh (working copy) @@ -25,10 +25,10 @@ // reasons why the executable file might be covered by the GNU General // Public License. -#ifndef OLENA_CORE_ABSTRACT_PSET_FIXED_HH -# define OLENA_CORE_ABSTRACT_PSET_FIXED_HH +#ifndef OLENA_CORE_ABSTRACT_POINT_SET_HAVING_KNOWN_SIZE_HH +# define OLENA_CORE_ABSTRACT_POINT_SET_HAVING_KNOWN_SIZE_HH -# include <oln/core/abstract/pset.hh> +# include <oln/core/abstract/point_set.hh> @@ -40,7 +40,7 @@ template <typename E> - class fixed_pset : public virtual pset<E> + class point_set_having_known_size : public virtual point_set<E> { public: @@ -50,7 +50,7 @@ } protected: - fixed_pset() + point_set_having_known_size() {} }; @@ -59,15 +59,15 @@ template <typename E> - struct case_ < pset_fixed_hierarchy, E, 1 > - : where_< mlc::eq_< oln_type_of(E, fixed), mlc::true_ > > + struct case_ < point_set_hierarchy_wrt_known_size, E, 1 > + : where_< mlc::eq_< oln_type_of(E, has_known_size), mlc::true_ > > { - typedef abstract::fixed_pset<E> ret; + typedef abstract::point_set_having_known_size<E> ret; }; } // end of namespace oln -#endif // ! OLENA_CORE_ABSTRACT_PSET_FIXED_HH +#endif // ! OLENA_CORE_ABSTRACT_POINT_SET_HAVING_KNOWN_SIZE_HH Index: oln/core/gen/fwd_piter.hh =================================================================== --- oln/core/gen/fwd_piter.hh (revision 548) +++ oln/core/gen/fwd_piter.hh (working copy) @@ -29,7 +29,7 @@ #ifndef OLENA_CORE_GEN_FWD_PITER_HH # define OLENA_CORE_GEN_FWD_PITER_HH -# include <oln/core/abstract/piter.hh> +# include <oln/core/abstract/iterator_on_points.hh> # include <oln/core/abstract/point.hh> # include <oln/core/gen/bbox.hh> @@ -47,7 +47,7 @@ struct set_super_type< fwd_piter_<point> > { typedef fwd_piter_<point> self_t; - typedef abstract::piter<self_t> ret; + typedef abstract::iterator_on_points<self_t> ret; }; @@ -63,11 +63,11 @@ /// Abstract forward point iterator class. template <typename point> - class fwd_piter_ : public abstract::piter< fwd_piter_<point> >, + class fwd_piter_ : public abstract::iterator_on_points< fwd_piter_<point> >, private mlc::assert_< mlc_is_a(point, abstract::point) > { typedef fwd_piter_<point> self_t; - typedef abstract::piter<self_t> super_t; + typedef abstract::iterator_on_points<self_t> super_t; using super_t::p_; Index: oln/core/gen/bkd_piter.hh =================================================================== --- oln/core/gen/bkd_piter.hh (revision 548) +++ oln/core/gen/bkd_piter.hh (working copy) @@ -29,7 +29,7 @@ #ifndef OLENA_CORE_GEN_BKD_PITER_HH # define OLENA_CORE_GEN_BKD_PITER_HH -# include <oln/core/abstract/piter.hh> +# include <oln/core/abstract/iterator_on_points.hh> # include <oln/core/abstract/point.hh> # include <oln/core/gen/bbox.hh> @@ -47,7 +47,7 @@ struct set_super_type< bkd_piter_<point> > { typedef bkd_piter_<point> self_t; - typedef abstract::piter<self_t> ret; + typedef abstract::iterator_on_points<self_t> ret; }; @@ -63,11 +63,11 @@ /// Abstract forward point iterator class. template <typename point> - class bkd_piter_ : public abstract::piter< bkd_piter_<point> >, + class bkd_piter_ : public abstract::iterator_on_points< bkd_piter_<point> >, private mlc::assert_< mlc_is_a(point, abstract::point) > { typedef bkd_piter_<point> self_t; - typedef abstract::piter<self_t> super_t; + typedef abstract::iterator_on_points<self_t> super_t; using super_t::p_;