https://svn.lrde.epita.fr/svn/oln/trunk/olena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Add the notion of image plus neighborhood and the underlying
mechanism.
* oln/debug/print_nbh.hh,
* oln/debug/iota.hh,
* oln/core/concept/image_identity.hh,
* oln/core/gen/op.hh,
* oln/core/internal/op_image_plus_nbh.hh,
* oln/core/internal/special_op.hh: New.
* oln/core/concept/image.hh (fwd_niter, bkd_niter, niter): New.
* oln/core/concept/neighborhood.hh (category): New.
(include): Add op_image_plus_nbh.hh.
(oln_decl_op_plus): New. Handle "Image + Neighborhood".
* oln/core/equipment.hh (left, right, oper, tag): New.
* oln/core/gen/single_value_image.hh: Fix.
* oln/core/internal/neighborhood_base.hh (category): New.
(neighborhood_base_): Fix inheritance.
* oln/core/internal/image_base.hh (image_extension_): New.
(image_base_): Add dpoint.
* oln/stc/scoop.hxx (vtypes, super_trait_): Add specialization
for const types.
(super_trait_): Handle error when not user-defined.
core/concept/image.hh | 5
core/concept/image_identity.hh | 292 +++++++++++++++++++++++++++++++++++++
core/concept/neighborhood.hh | 6
core/equipment.hh | 6
core/gen/op.hh | 162 ++++++++++++++++++++
core/gen/single_value_image.hh | 5
core/internal/image_base.hh | 35 ++++
core/internal/neighborhood_base.hh | 3
core/internal/op_image_plus_nbh.hh | 102 ++++++++++++
core/internal/special_op.hh | 76 +++++++++
debug/iota.hh | 56 +++++++
debug/print_nbh.hh | 101 ++++++++++++
stc/scoop.hxx | 21 ++
13 files changed, 863 insertions(+), 7 deletions(-)
Index: oln/debug/print_nbh.hh
--- oln/debug/print_nbh.hh (revision 0)
+++ oln/debug/print_nbh.hh (revision 0)
@@ -0,0 +1,101 @@
+// Copyright (C) 2007 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_DEBUG_PRINT_NBH_HH
+# define OLN_DEBUG_PRINT_NBH_HH
+
+# include <iostream>
+# include <oln/core/concept/image.hh>
+
+
+namespace oln
+{
+
+ namespace debug
+ {
+
+ // fwd decl
+ template <typename I>
+ void print_nbh(const Image_with_Nbh<I>& input, std::ostream& ostr = std::cout);
+
+
+ namespace impl
+ {
+
+ // Image
+
+ template <typename I>
+ void print_nbh(const Image<I>&, const I& input, std::ostream& ostr)
+ {
+ typename I::fwd_piter p(input.points());
+ typename I::fwd_niter n(p, input.nbhood());
+ for_all(p)
+ {
+ ostr << input(p) << ": ";
+ for_all(n)
+ if (input.owns_(n))
+ ostr << input(n) << " ";
+ ostr << std::endl;
+ }
+ }
+
+
+ // Point_Wise_Accessible_Image
+
+ template <typename I>
+ void print_nbh(const Point_Wise_Accessible_Image<I>&,const I& input, std::ostream& ostr)
+ {
+ typename I::fwd_piter p(input.points());
+ typename I::fwd_niter n(p, input.nbhood());
+ for_all(p)
+ {
+ ostr << input(p) << ": ";
+ for_all(n)
+ if (input.has(n))
+ ostr << input(n) << " ";
+ ostr << std::endl;
+ }
+ }
+
+ } // end of namespace oln::debug::impl
+
+
+ // facade
+ template <typename I>
+ void print_nbh(const Image_with_Nbh<I>& input, std::ostream& ostr)
+ {
+ impl::print_nbh(exact(input), exact(input), ostr);
+ }
+
+
+
+ } // end of namespace oln::debug
+
+} // end of namespace oln
+
+
+#endif // ! OLN_DEBUG_PRINT_NBH_HH
Index: oln/debug/iota.hh
--- oln/debug/iota.hh (revision 0)
+++ oln/debug/iota.hh (revision 0)
@@ -0,0 +1,56 @@
+// Copyright (C) 2007 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_DEBUG_IOTA_HH
+# define OLN_DEBUG_IOTA_HH
+
+# include <oln/core/concept/image.hh>
+
+
+namespace oln
+{
+
+ namespace debug
+ {
+
+
+ template <typename I>
+ void iota(Mutable_Image<I>& in_out)
+ {
+ typename I::value v = 0;
+ typename I::fwd_piter p(in_out.points());
+ for_all(p)
+ in_out(p) = v++;
+ }
+
+
+ } // end of namespace oln::debug
+
+} // end of namespace oln
+
+
+#endif // ! OLN_DEBUG_IOTA_HH
Index: oln/core/concept/image.hh
--- oln/core/concept/image.hh (revision 858)
+++ oln/core/concept/image.hh (working copy)
@@ -142,6 +142,11 @@
public automatic::get_impl<Image_with_Nbh, Exact>
{
stc_typename(nbh);
+
+ stc_typename(fwd_niter);
+ stc_typename(bkd_niter);
+ typedef fwd_niter niter;
+
nbh nbhood() const;
protected:
Index: oln/core/concept/neighborhood.hh
--- oln/core/concept/neighborhood.hh (revision 858)
+++ oln/core/concept/neighborhood.hh (working copy)
@@ -29,6 +29,9 @@
# define OLN_CORE_CONCEPT_NEIGHBORHOOD_HH
# include <oln/core/equipment.hh>
+# include <oln/core/internal/op_image_plus_nbh.hh>
+
+
namespace oln
@@ -41,6 +44,7 @@
{
stc_typename(grid);
stc_typename(point);
+ stc_typename(category);
protected:
Neighborhood();
@@ -48,6 +52,8 @@
}; // end of oln::Neighborhood<Exact>
+ oln_decl_op_plus(Image, Neighborhood);
+
# ifndef OLN_INCLUDE_ONLY
Index: oln/core/concept/image_identity.hh
--- oln/core/concept/image_identity.hh (revision 0)
+++ oln/core/concept/image_identity.hh (revision 0)
@@ -0,0 +1,292 @@
+// Copyright (C) 2007 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_CONCEPT_IMAGE_IDENTITY_HH
+# define OLN_CORE_CONCEPT_IMAGE_IDENTITY_HH
+
+# include <oln/core/concept/image.hh>
+
+
+
+namespace oln
+{
+
+ namespace behavior { struct identity; }
+
+
+ namespace automatic
+ {
+
+
+ /// Concept-class "Image".
+
+ template <typename Exact>
+ struct set_impl< Image, behavior::identity, Exact > : public virtual Any<Exact>
+ {
+ stc_typename(psite);
+ stc_typename(rvalue);
+ stc_typename(box);
+ stc_typename(pset);
+
+ bool impl_owns_(const psite& p) const;
+ rvalue impl_read(const psite& p) const;
+ box impl_bbox() const;
+ pset impl_points() const;
+ };
+
+
+ /// Concept-class "Image_with_Nbh".
+
+ template <typename Exact>
+ struct set_impl< Image_with_Nbh, behavior::identity, Exact > : public virtual Any<Exact>
+ {
+ stc_typename(nbh);
+ nbh impl_nbhood() const;
+ };
+
+
+ /// Concept-class "Mutable_Image".
+
+ template <typename Exact>
+ struct set_impl< Mutable_Image, behavior::identity, Exact > : public virtual Any<Exact>
+ {
+ stc_typename(psite);
+ stc_typename(lvalue);
+ lvalue impl_read_write(const psite& p);
+ };
+
+
+ /// Concept-class "Fast_Image".
+
+ template <typename Exact>
+ struct set_impl< Fast_Image, behavior::identity, Exact > : public virtual Any<Exact>
+ {
+ stc_typename(rvalue);
+ stc_typename(lvalue);
+ stc_typename(index);
+
+ rvalue impl_index_read(index i) const;
+ lvalue impl_index_read_write(index i);
+ std::size_t impl_npoints() const;
+ };
+
+
+ /// Concept-class "Point_Wise_Accessible_Image".
+
+ template <typename Exact>
+ struct set_impl< Point_Wise_Accessible_Image, behavior::identity, Exact > : public virtual Any<Exact>
+ {
+ stc_typename(point);
+ bool impl_has(const point& p) const;
+ };
+
+
+ /// Concept-class "Value_Wise_Accessible_Image".
+
+ template <typename Exact>
+ struct set_impl< Value_Wise_Accessible_Image, behavior::identity, Exact > : public virtual Any<Exact>
+ {
+ stc_typename(vsite);
+ stc_typename(rvaluep);
+ rvaluep impl_value_read(const vsite& v) const;
+ };
+
+
+ /// Concept-class "Value_Wise_Mutable_Image".
+
+ template <typename Exact>
+ struct set_impl< Value_Wise_Mutable_Image, behavior::identity, Exact > : public virtual Any<Exact>
+ {
+ stc_typename(vsite);
+ stc_typename(lvaluep);
+ lvaluep impl_value_read_write(const vsite& v);
+ };
+
+
+ /// Concept-class "Image_1D".
+
+ template <typename Exact>
+ struct set_impl< Image_1D, behavior::identity, Exact > : public virtual Any<Exact>
+ {
+ };
+
+
+ /// Concept-class "Image_2D".
+
+ template <typename Exact>
+ struct set_impl< Image_2D, behavior::identity, Exact > : public virtual Any<Exact>
+ {
+ };
+
+
+ /// Concept-class "Image_3D".
+
+ template <typename Exact>
+ struct set_impl< Image_3D, behavior::identity, Exact > : public virtual Any<Exact>
+ {
+ };
+
+
+ /// Concept-class "Point_Wise_Accessible_Image_2D".
+
+ template <typename Exact>
+ struct set_impl< Point_Wise_Accessible_Image_2D, behavior::identity, Exact > : public virtual Any<Exact>
+ {
+ // default code is provided in Point_Wise_Accessible_Image_2D<Exact>
+ };
+
+
+ /// Concept-class "Point_Wise_Mutable_Image_2D".
+
+ template <typename Exact>
+ struct set_impl< Point_Wise_Mutable_Image_2D, behavior::identity, Exact > : public virtual Any<Exact>
+ {
+ // default code is provided in Point_Wise_Mutable_Image_2D<Exact>
+ };
+
+
+
+
+
+
+# ifndef OLN_INCLUDE_ONLY
+
+
+ /// Concept-class "Image".
+
+ template <typename Exact>
+ bool
+ set_impl< Image, behavior::identity, Exact >::impl_owns_(const typename set_impl< Image, behavior::identity, Exact >::psite& p) const
+ {
+ return exact(this)->image().owns_(p);
+ }
+
+ template <typename Exact>
+ typename set_impl< Image, behavior::identity, Exact >::rvalue
+ set_impl< Image, behavior::identity, Exact >::impl_read(const typename set_impl< Image, behavior::identity, Exact >::psite& p) const
+ {
+ return exact(this)->image()(p);
+ }
+
+ template <typename Exact>
+ typename set_impl< Image, behavior::identity, Exact >::box
+ set_impl< Image, behavior::identity, Exact >::impl_bbox() const
+ {
+ return exact(this)->image().bbox();
+ }
+
+ template <typename Exact>
+ typename set_impl< Image, behavior::identity, Exact >::pset
+ set_impl< Image, behavior::identity, Exact >::impl_points() const
+ {
+ return exact(this)->image().points();
+ }
+
+
+ /// Concept-class "Image_with_Nbh".
+
+ template <typename Exact>
+ typename set_impl< Image_with_Nbh, behavior::identity, Exact >::nbh
+ set_impl< Image_with_Nbh, behavior::identity, Exact >::impl_nbhood() const
+ {
+ return exact(this)->image().nbhood();
+ }
+
+
+ /// Concept-class "Mutable_Image".
+
+ template <typename Exact>
+ typename set_impl< Mutable_Image, behavior::identity, Exact >::lvalue
+ set_impl< Mutable_Image, behavior::identity, Exact >::impl_read_write(const typename set_impl< Mutable_Image, behavior::identity, Exact >::psite& p)
+ {
+ return exact(this)->image().operator()(p);
+ }
+
+
+ /// Concept-class "Fast_Image".
+
+ template <typename Exact>
+ typename set_impl< Fast_Image, behavior::identity, Exact >::rvalue
+ set_impl< Fast_Image, behavior::identity, Exact >::impl_index_read(typename set_impl< Fast_Image, behavior::identity, Exact >::index i) const
+ {
+ return exact(this)->image()[i];
+ }
+
+ template <typename Exact>
+ typename set_impl< Fast_Image, behavior::identity, Exact >::lvalue
+ set_impl< Fast_Image, behavior::identity, Exact >::impl_index_read_write(typename set_impl< Fast_Image, behavior::identity, Exact >::index i)
+ {
+ return exact(this)->image()[i];
+ }
+
+ template <typename Exact>
+ std::size_t
+ set_impl< Fast_Image, behavior::identity, Exact >::impl_npoints() const
+ {
+ return exact(this)->image().npoints();
+ }
+
+
+ /// Concept-class "Point_Wise_Accessible_Image".
+
+ template <typename Exact>
+ bool
+ set_impl< Point_Wise_Accessible_Image, behavior::identity, Exact >::impl_has(const typename set_impl< Point_Wise_Accessible_Image, behavior::identity, Exact >::point& p) const
+ {
+ return exact(this)->image().has(p);
+ }
+
+
+ /// Concept-class "Value_Wise_Accessible_Image".
+
+ template <typename Exact>
+ typename set_impl< Value_Wise_Accessible_Image, behavior::identity, Exact >::rvaluep
+ set_impl< Value_Wise_Accessible_Image, behavior::identity, Exact >::impl_value_read(const typename set_impl< Value_Wise_Accessible_Image, behavior::identity, Exact >::vsite& v) const
+ {
+ return exact(this)->image().value(v);
+ }
+
+
+ /// Concept-class "Value_Wise_Mutable_Image".
+
+ template <typename Exact>
+ typename set_impl< Value_Wise_Mutable_Image, behavior::identity, Exact >::lvaluep
+ set_impl< Value_Wise_Mutable_Image, behavior::identity, Exact >::impl_value_read_write(const typename set_impl< Value_Wise_Mutable_Image, behavior::identity, Exact >::vsite& v)
+ {
+ return exact(this)->image().value(v);
+ }
+
+
+# endif
+
+
+ } // end of namespace oln::automatic
+
+} // end of namespace oln
+
+
+#endif // ! OLN_CORE_CONCEPT_IMAGE_IDENTITY_HH
Index: oln/core/equipment.hh
--- oln/core/equipment.hh (revision 858)
+++ oln/core/equipment.hh (working copy)
@@ -66,6 +66,7 @@
stc_decl_associated_type( index );
// l
+ stc_decl_associated_type( left );
stc_decl_associated_type( lvalue );
stc_decl_associated_type( lvaluep );
@@ -75,6 +76,7 @@
stc_decl_associated_type( niter );
// o
+ stc_decl_associated_type( oper );
stc_decl_associated_type( output );
// p
@@ -87,12 +89,16 @@
stc_decl_associated_type( qiter );
// r
+ stc_decl_associated_type( right );
stc_decl_associated_type( rvalue );
stc_decl_associated_type( rvaluep );
// s
stc_decl_associated_type( std_container );
+ // t
+ stc_decl_associated_type( tag );
+
// v
stc_decl_associated_type( value );
stc_decl_associated_type( vsite );
Index: oln/core/gen/op.hh
--- oln/core/gen/op.hh (revision 0)
+++ oln/core/gen/op.hh (revision 0)
@@ -0,0 +1,162 @@
+// Copyright (C) 2007 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_OP_HH
+# define OLN_CORE_GEN_OP_HH
+
+# include <oln/core/internal/special_op.hh>
+
+
+
+// Macro.
+
+# define oln_decl_op_(OpName, Lconcept, OpSym, Rconcept) \
+ \
+ template <typename L, typename R> \
+ op_<L, OpName, R> \
+ operator OpSym (Lconcept<L>& lhs, Rconcept<R>& rhs) \
+ { \
+ op_<L, OpName, R> tmp(exact(lhs), exact(rhs)); \
+ return tmp; \
+ } \
+ \
+ template <typename L, typename R> \
+ op_<L, OpName, const R> \
+ operator OpSym (Lconcept<L>& lhs, const Rconcept<R>& rhs) \
+ { \
+ op_<L, OpName, const R> tmp(exact(lhs), exact(rhs)); \
+ return tmp; \
+ } \
+ \
+ template <typename L, typename R> \
+ op_<const L, OpName, R> \
+ operator OpSym (const Lconcept<L>& lhs, Rconcept<R>& rhs) \
+ { \
+ op_<const L, OpName, R> tmp(exact(lhs), exact(rhs)); \
+ return tmp; \
+ } \
+ \
+ template <typename L, typename R> \
+ op_<const L, OpName, const R> \
+ operator OpSym (const Lconcept<L>& lhs, const Rconcept<R>& rhs) \
+ { \
+ op_<const L, OpName, const R> tmp(exact(lhs), exact(rhs)); \
+ return tmp; \
+ } \
+ \
+ struct e_n_d___w_i_t_h___a___s_e_m_i___c_o_l_u_m_n
+
+
+# define oln_decl_op_plus(Lconcept, Rconcept) oln_decl_op_(plus, Lconcept, +, Rconcept)
+# define oln_decl_op_such_as(Lconcept, Rconcept) oln_decl_op_(such_as, Lconcept, |, Rconcept)
+// ...
+
+
+
+
+# define oln_category_of_(Type) typename oln::internal::category_of_<Type>::ret
+
+
+namespace oln
+{
+
+
+ namespace internal
+ {
+ template <typename T>
+ struct category_of_
+ {
+ typedef stc_type(T, category) ret;
+ };
+
+ // ...
+
+ } // end of namespace oln::internal
+
+
+
+ /// \{
+ /// Operator Names.
+
+ struct plus;
+ struct such_as;
+
+ /// \}
+
+
+
+ // Fwd decl.
+ template <typename L, typename OpName, typename R> class op_;
+
+
+ /// Virtual types.
+ template <typename L, typename OpName, typename R>
+ struct vtypes< op_<L, OpName, R> >
+ {
+ };
+
+
+ /// Super type.
+
+# define super \
+ internal::special_op_< oln_category_of_(L), L, OpName, oln_category_of_(R), R >
+
+ template <typename L, typename OpName, typename R>
+ struct super_trait_< op_<L, OpName, R> >
+ {
+ typedef super ret;
+ };
+
+
+ /// Class for result of "L op R".
+
+ template <typename L, typename OpName, typename R>
+ class op_ : public super
+ {
+ public:
+ op_(L& l, R& r);
+
+ }; // end of op_<L, OpName, R>
+
+
+
+# ifndef OLN_INCLUDE_ONLY
+
+ template <typename L, typename OpName, typename R>
+ op_<L, OpName, R>::op_(L& l, R& r)
+ : super (l, r)
+ {
+ }
+
+# endif
+
+# undef super
+
+} // end of namespace oln
+
+
+#endif // ! OLN_CORE_GEN_OP_HH
Index: oln/core/gen/single_value_image.hh
--- oln/core/gen/single_value_image.hh (revision 858)
+++ oln/core/gen/single_value_image.hh (working copy)
@@ -54,11 +54,6 @@
typedef const T& rvalue;
typedef internal::pair<Ps, T> data;
-
- // FIXME: To be defined...
- typedef mlc::none qiter;
- typedef mlc::none fwd_qiter;
- typedef mlc::none bkd_qiter;
};
Index: oln/core/internal/neighborhood_base.hh
--- oln/core/internal/neighborhood_base.hh (revision 858)
+++ oln/core/internal/neighborhood_base.hh (working copy)
@@ -56,6 +56,7 @@
typedef stc_deferred(point) point__;
typedef stc::final< stc_type(point__, grid) > grid;
+ typedef stc::final< stc::is<Neighborhood> > category;
};
@@ -65,7 +66,7 @@
/// Base class for implementation of neighborhoods class.
template <typename Exact>
- class neighborhood_base_ : public Neighborhood< neighb_<Exact> >
+ class neighborhood_base_ : public Neighborhood<Exact>
{
protected:
neighborhood_base_();
Index: oln/core/internal/op_image_plus_nbh.hh
--- oln/core/internal/op_image_plus_nbh.hh (revision 0)
+++ oln/core/internal/op_image_plus_nbh.hh (revision 0)
@@ -0,0 +1,102 @@
+// Copyright (C) 2007 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_INTERNAL_OP_IMAGE_PLUS_NBH_HH
+# define OLN_CORE_INTERNAL_OP_IMAGE_PLUS_NBH_HH
+
+# include <oln/core/gen/op.hh>
+# include <oln/core/gen/dpoints_piter.hh>
+# include <oln/core/internal/image_base.hh>
+
+
+namespace oln
+{
+
+ /// Fwd decls.
+ template <typename Exact> struct Image;
+ template <typename Exact> struct Neighborhood;
+
+
+ /// Super type.
+ template <typename I, typename N>
+ struct super_trait_< internal::special_op_<stc::is<Image>, I, plus, stc::is<Neighborhood>, N> >
+ {
+ typedef internal::image_extension_< op_<I, plus, N> > ret;
+ };
+
+
+ /// Virtual types.
+ template <typename I, typename N>
+ struct vtypes< internal::special_op_<stc::is<Image>, I, plus, stc::is<Neighborhood>, N> >
+ {
+ typedef op_<I, plus, N> Exact;
+ typedef stc_type(I, point) point__;
+
+ typedef I delegatee;
+ typedef internal::pair<I,N> data;
+
+ typedef N nbh;
+ typedef dpoints_fwd_piter_<point__> fwd_niter;
+ typedef dpoints_bkd_piter_<point__> bkd_niter;
+ };
+
+
+ namespace internal
+ {
+
+ /// Implementation class the result of "Image I + Neighborhood N".
+
+ template <typename I, typename N>
+ class special_op_< stc::is<Image>, I, plus, stc::is<Neighborhood>, N >
+ :
+ public internal::image_extension_< op_<I, plus, N> >
+ {
+ typedef internal::image_extension_< op_<I, plus, N> > super;
+ public:
+ stc_using(nbh);
+ stc_using(data);
+ stc_using(delegatee);
+
+ delegatee& impl_image() { assert(this->has_data()); return this->data_->value1; }
+ const delegatee& impl_image() const { assert(this->has_data()); return this->data_->value1; }
+
+ nbh impl_nbhood() const { assert(this->has_data()); return this->data_->value2; }
+
+ protected:
+ special_op_(I& ima, N& n)
+ {
+ this->data_ = new data(ima, n);
+ }
+ };
+
+
+ } // end of namespace oln::internal
+
+} // end of namespace oln
+
+
+#endif // ! OLN_CORE_INTERNAL_OP_IMAGE_PLUS_NBH_HH
Index: oln/core/internal/image_base.hh
--- oln/core/internal/image_base.hh (revision 858)
+++ oln/core/internal/image_base.hh (working copy)
@@ -29,10 +29,11 @@
# define OLN_CORE_INTERNAL_IMAGE_BASE_HH
# include <oln/core/internal/image_selectors.hh>
+# include <oln/core/concept/image_identity.hh>
+
# include <oln/core/internal/tracked_ptr.hh>
# include <oln/core/internal/utils.hh>
# include <oln/core/gen/box.hh>
-# include <oln/core/gen/image_pset_piter.hh>
@@ -50,6 +51,7 @@
template <typename Exact> struct image_morpher_;
template <typename Exact> struct single_image_morpher_;
+ template <typename Exact> struct image_extension_;
template <typename Exact> struct multiple_image_morpher_;
}
@@ -87,6 +89,12 @@
};
template <typename Exact>
+ struct super_trait_< internal::image_extension_<Exact> >
+ {
+ typedef internal::single_image_morpher_<Exact> ret;
+ };
+
+ template <typename Exact>
struct super_trait_< internal::multiple_image_morpher_<Exact> >
{
typedef internal::image_morpher_<Exact> ret;
@@ -122,6 +130,7 @@
typedef stc::final< stc::is<Image> > category;
typedef stc::final< box_<point__> > box;
typedef stc::final< stc_type(point__, grid) > grid;
+ typedef stc::final< stc_type(point__, dpoint) > dpoint;
typedef stc::final< typename pset__::fwd_piter > fwd_piter;
typedef stc::final< typename pset__::bkd_piter > bkd_piter;
typedef fwd_piter piter;
@@ -145,6 +154,7 @@
struct vtypes< internal::image_morpher_<Exact> >
{
typedef stc::abstract delegatee;
+ typedef stc::abstract behavior;
typedef stc::not_delegated data;
};
@@ -154,6 +164,12 @@
};
template <typename Exact>
+ struct vtypes< internal::image_extension_<Exact> >
+ {
+ typedef stc::final< behavior::identity > behavior;
+ };
+
+ template <typename Exact>
struct vtypes< internal::multiple_image_morpher_<Exact> >
{
typedef stc::abstract n;
@@ -239,6 +255,16 @@
};
+ /// image_extension_<Exact>
+
+ template <typename Exact>
+ class image_extension_ : public single_image_morpher_<Exact>
+ {
+ protected:
+ image_extension_();
+ };
+
+
/// multiple_image_morpher_<Exact>
template <typename Exact>
@@ -320,6 +346,13 @@
{
}
+ // image_extension_<Exact>
+
+ template <typename Exact>
+ image_extension_<Exact>::image_extension_()
+ {
+ }
+
// multiple_image_morpher_<Exact>
template <typename Exact>
Index: oln/core/internal/special_op.hh
--- oln/core/internal/special_op.hh (revision 0)
+++ oln/core/internal/special_op.hh (revision 0)
@@ -0,0 +1,76 @@
+// Copyright (C) 2007 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_INTERNAL_SPECIAL_OP_HH
+# define OLN_CORE_INTERNAL_SPECIAL_OP_HH
+
+# include <oln/core/internal/image_base.hh>
+
+
+namespace oln
+{
+
+
+ // Fwd decls.
+ namespace internal {
+ template <typename Lcat, typename L, typename OpName, typename Rcat, typename R>
+ class special_op_;
+ }
+ template <typename L, typename OpName, typename R> class op_;
+
+
+ /// Virtual types.
+ template <typename Lcat, typename L, typename OpName, typename Rcat, typename R>
+ struct vtypes< internal::special_op_<Lcat, L, OpName, Rcat, R> >
+ /* undefined; to be specialized... */
+ ;
+
+
+ /// Super type.
+ template <typename Lcat, typename L, typename OpName, typename Rcat, typename R>
+ struct super_trait_< internal::special_op_<Lcat, L, OpName, Rcat, R> >
+ /* undefined; to be specialized... */
+ ;
+
+
+ namespace internal
+ {
+
+ /// Class for result of "L op R".
+
+ template <typename Lcat, typename L, typename OpName, typename Rcat, typename R>
+ class special_op_;
+ /* undefined; to be specialized... */
+
+
+ } // end of namespace oln::internal
+
+
+} // end of namespace oln
+
+
+#endif // ! OLN_CORE_INTERNAL_SPECIAL_OP_HH
Index: oln/stc/scoop.hxx
--- oln/stc/scoop.hxx (revision 858)
+++ oln/stc/scoop.hxx (working copy)
@@ -56,6 +56,9 @@
struct no_delegatee_declared_;
+ template <typename T>
+ struct super_trait_not_defined_for_;
+
} /* end of namespace ERROR */
@@ -69,6 +72,11 @@
{
};
+template <typename from_type>
+struct vtypes <const from_type> : public vtypes <from_type>
+{
+};
+
template <typename from_type, typename type>
struct single_vtype
{
@@ -77,17 +85,30 @@
+/* super_trait_ */
template <typename from_type>
struct super_trait_;
+template <typename from_type>
+struct super_trait_ <const from_type> : super_trait_<from_type>
+{
+};
+
template <template <class> class abstraction, typename Exact>
struct super_trait_< abstraction<Exact> >
{
typedef mlc::none ret;
};
+template <typename from_type>
+struct super_trait_ :
+ mlc::abort_< ERROR::super_trait_not_defined_for_<from_type> >
+{
+ typedef mlc::none ret;
+};
+
https://svn.lrde.epita.fr/svn/oln/trunk/olena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Move the responsibility of iteration on window points from
images to windows.
* ChangeLog: Add missing former entry.
* core/concept/image.hh (value): Add missing code.
(qiter, fwd_qiter, bkd_qiter): Move to...
* core/concept/window.hh: ...here.
(point): New virtual type.
* core/concept/neighborhood.hh (point): Likewise.
* core/2d/aliases.hh,
* core/2d/neighb2d.hh,
* core/2d/dpoint2d.hh,
* core/2d/window2d.hh,
* core/2d/box2d.hh: Update.
* core/gen/dpoints_piter.hh (include): Remove useless ones.
* oln/core/internal/neighborhood_base.hh: New.
* core/gen/neighb.hh: Update inheritance.
* oln/core/internal/window_base.hh: New.
* core/gen/window.hh: Update inheritance.
(vtypes): Update.
* core/internal/point_set_std_based.hh: Fix missing return.
* core/internal/image_base.hh: Update.
* core/internal/point2d.hh: Fix wrong visibility.
2d/aliases.hh | 35 ++++++++------
2d/box2d.hh | 3 -
2d/dpoint2d.hh | 4 +
2d/neighb2d.hh | 3 -
2d/point2d.hh | 4 +
2d/window2d.hh | 5 +-
concept/image.hh | 4 -
concept/neighborhood.hh | 1
concept/window.hh | 6 ++
gen/dpoints_piter.hh | 6 --
gen/neighb.hh | 8 +--
gen/single_value_image.hh | 2
gen/window.hh | 11 ++--
internal/image_base.hh | 4 -
internal/neighborhood_base.hh | 92 ++++++++++++++++++++++++++++++++++++++
internal/point2d.hh | 2
internal/point_set_std_based.hh | 1
internal/window_base.hh | 96 ++++++++++++++++++++++++++++++++++++++++
18 files changed, 249 insertions(+), 38 deletions(-)
Index: oln/core/concept/image.hh
--- oln/core/concept/image.hh (revision 857)
+++ oln/core/concept/image.hh (working copy)
@@ -195,9 +195,6 @@
{
stc_using_from(Image, point);
- stc_typename(qiter);
- stc_typename(fwd_qiter);
- stc_typename(bkd_qiter);
bool has(const point& p) const;
protected:
@@ -454,6 +451,7 @@
typename Value_Wise_Mutable_Image<Exact>::lvaluep
Value_Wise_Mutable_Image<Exact>::value(const typename Value_Wise_Accessible_Image<Exact>::vsite& v)
{
+ return exact(this)->impl_value_read_write(v);
}
template <typename Exact>
Index: oln/core/concept/window.hh
--- oln/core/concept/window.hh (revision 857)
+++ oln/core/concept/window.hh (working copy)
@@ -29,6 +29,7 @@
# define OLN_CORE_CONCEPT_WINDOW_HH
# include <oln/core/equipment.hh>
+# include <oln/core/concept/point.hh>
namespace oln
@@ -40,6 +41,11 @@
struct Window : public Any<Exact>
{
stc_typename(grid);
+ stc_typename(point);
+
+ stc_typename(qiter);
+ stc_typename(fwd_qiter);
+ stc_typename(bkd_qiter);
protected:
Window();
Index: oln/core/concept/neighborhood.hh
--- oln/core/concept/neighborhood.hh (revision 857)
+++ oln/core/concept/neighborhood.hh (working copy)
@@ -40,6 +40,7 @@
struct Neighborhood : public Any<Exact>
{
stc_typename(grid);
+ stc_typename(point);
protected:
Neighborhood();
Index: oln/core/2d/aliases.hh
--- oln/core/2d/aliases.hh (revision 857)
+++ oln/core/2d/aliases.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2001, 2003, 2004, 2005, 2006 EPITA Research and
+// Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007 EPITA Research and
// Development Laboratory
//
// This file is part of the Olena Library. This library is free
@@ -35,29 +35,36 @@
/// Forward declarations.
/// \{
+
+ template <typename P> class box_;
+ template <typename P> class box_fwd_piter_;
+ template <typename P> class box_bkd_piter_;
+
template <typename D> class neighb_;
template <typename D> class window_;
- template <typename P> class topo_lbbox_;
- template <typename P> class fwd_piter_bbox_;
- template <typename P> class bkd_piter_bbox_;
- template <typename P> class fwd_qiter_win_;
- template <typename P> class bkd_qiter_win_;
+ template <typename P> class dpoints_fwd_piter_;
+ template <typename P> class dpoints_bkd_piter_;
+
/// \}
/// Aliases.
/// \{
- typedef neighb_<dpoint2d> neighb2d;
- typedef window_<dpoint2d> window2d;
-
- typedef topo_lbbox_<point2d> topo2d;
+ typedef box_<point2d> box2d;
+ typedef box_fwd_piter_<point2d> piter2d;
+ typedef box_fwd_piter_<point2d> fwd_piter2d;
+ typedef box_bkd_piter_<point2d> bkd_piter2d;
- typedef fwd_piter_bbox_<point2d> fwd_piter2d;
- typedef bkd_piter_bbox_<point2d> bkd_piter2d;
+ typedef neighb_<dpoint2d> neighb2d;
+ typedef dpoints_fwd_piter_<point2d> niter2d;
+ typedef dpoints_fwd_piter_<point2d> fwd_niter2d;
+ typedef dpoints_bkd_piter_<point2d> bkd_niter2d;
- typedef fwd_qiter_win_<point2d> fwd_qiter2d;
- typedef bkd_qiter_win_<point2d> bkd_qiter2d;
+ typedef window_<dpoint2d> window2d;
+ typedef dpoints_fwd_piter_<point2d> qiter2d;
+ typedef dpoints_fwd_piter_<point2d> fwd_qiter2d;
+ typedef dpoints_bkd_piter_<point2d> bkd_qiter2d;
/// \}
Index: oln/core/2d/neighb2d.hh
--- oln/core/2d/neighb2d.hh (revision 857)
+++ oln/core/2d/neighb2d.hh (working copy)
@@ -31,12 +31,13 @@
# include <oln/core/gen/neighb.hh>
# include <oln/core/2d/dpoint2d.hh>
+# include <oln/core/2d/aliases.hh>
namespace oln
{
- typedef neighb_<dpoint2d> neighb2d;
+ // FIXME: neighb2d should be an actual type, not an alias...
namespace internal
Index: oln/core/2d/dpoint2d.hh
--- oln/core/2d/dpoint2d.hh (revision 857)
+++ oln/core/2d/dpoint2d.hh (working copy)
@@ -88,4 +88,8 @@
} // end of namespace oln
+// dpoint2d goes with point2d so:
+# include <oln/core/2d/point2d.hh>
+
+
#endif // ! OLN_CORE_2D_DPOINT2D_HH
Index: oln/core/2d/window2d.hh
--- oln/core/2d/window2d.hh (revision 857)
+++ oln/core/2d/window2d.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2006 EPITA Research and Development Laboratory
+// Copyright (C) 2006, 2007 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
@@ -30,12 +30,13 @@
# include <oln/core/gen/window.hh>
# include <oln/core/2d/dpoint2d.hh>
+# include <oln/core/2d/aliases.hh>
namespace oln
{
- typedef window_<dpoint2d> window2d;
+ // FIXME: window2d should be an actual type, not an alias...
window2d mk_square(unsigned odd_len);
Index: oln/core/2d/box2d.hh
--- oln/core/2d/box2d.hh (revision 857)
+++ oln/core/2d/box2d.hh (working copy)
@@ -30,12 +30,13 @@
# include <oln/core/gen/box.hh>
# include <oln/core/2d/point2d.hh>
+# include <oln/core/2d/aliases.hh>
namespace oln
{
- typedef box_<point2d> box2d;
+ // FIXME: box2d should be an actual type, not an alias...
} // end of namespace oln
Index: oln/core/2d/point2d.hh
--- oln/core/2d/point2d.hh (revision 857)
+++ oln/core/2d/point2d.hh (working copy)
@@ -88,4 +88,8 @@
} // end of namespace oln
+// point2d goes with dpoint2d so:
+# include <oln/core/2d/dpoint2d.hh>
+
+
#endif // ! OLN_CORE_2D_POINT2D_HH
Index: oln/core/gen/dpoints_piter.hh
--- oln/core/gen/dpoints_piter.hh (revision 857)
+++ oln/core/gen/dpoints_piter.hh (working copy)
@@ -29,8 +29,6 @@
# define OLN_CORE_GEN_DPOINTS_PITER_HH
# include <oln/core/concept/iterator_on_points.hh>
-# include <oln/core/concept/window.hh>
-# include <oln/core/concept/neighborhood.hh>
# include <oln/core/internal/dpoints_impl.hh>
@@ -39,8 +37,8 @@
/// Fwd decls.
- template <typename P> struct dpoints_fwd_piter_;
- template <typename P> struct dpoints_bkd_piter_;
+ template <typename P> class dpoints_fwd_piter_;
+ template <typename P> class dpoints_bkd_piter_;
// Super types.
Index: oln/core/gen/neighb.hh
--- oln/core/gen/neighb.hh (revision 857)
+++ oln/core/gen/neighb.hh (working copy)
@@ -30,7 +30,7 @@
# define OLN_CORE_GEN_NEIGHB_HH
# include <oln/core/internal/dpoints_impl.hh>
-# include <oln/core/concept/neighborhood.hh>
+# include <oln/core/internal/neighborhood_base.hh>
namespace oln
@@ -46,7 +46,7 @@
struct super_trait_< neighb_<Dp> >
{
typedef neighb_<Dp> current__;
- typedef Neighborhood<current__> ret;
+ typedef internal::neighborhood_base_<current__> ret;
};
@@ -54,14 +54,14 @@
template <typename Dp>
struct vtypes< neighb_<Dp> >
{
- typedef stc_type(Dp, grid) grid;
+ typedef stc_type(Dp, point) point;
};
/// Generic classical neighborhood class.
template <typename Dp>
- class neighb_ : public Neighborhood< neighb_<Dp> >,
+ class neighb_ : public internal::neighborhood_base_< neighb_<Dp> >,
public internal::dpoints_impl_<Dp>
{
public:
Index: oln/core/gen/window.hh
--- oln/core/gen/window.hh (revision 857)
+++ oln/core/gen/window.hh (working copy)
@@ -28,8 +28,9 @@
#ifndef OLN_CORE_GEN_WINDOW_HH
# define OLN_CORE_GEN_WINDOW_HH
+# include <oln/core/internal/window_base.hh>
# include <oln/core/internal/dpoints_impl.hh>
-# include <oln/core/concept/window.hh>
+# include <oln/core/gen/dpoints_piter.hh>
namespace oln
@@ -45,7 +46,7 @@
struct super_trait_< window_<Dp> >
{
typedef window_<Dp> current__;
- typedef Window<current__> ret;
+ typedef internal::window_base_<current__> ret;
};
@@ -53,14 +54,16 @@
template <typename Dp>
struct vtypes< window_<Dp> >
{
- typedef stc_type(Dp, grid) grid;
+ typedef stc_type(Dp, point) point;
+ typedef dpoints_fwd_piter_<point> fwd_qiter;
+ typedef dpoints_bkd_piter_<point> bkd_qiter;
};
/// Generic classical windoworhood class.
template <typename Dp>
- class window_ : public Window< window_<Dp> >,
+ class window_ : public internal::window_base_< window_<Dp> >,
public internal::dpoints_impl_<Dp>
{
public:
Index: oln/core/gen/single_value_image.hh
--- oln/core/gen/single_value_image.hh (revision 857)
+++ oln/core/gen/single_value_image.hh (working copy)
@@ -48,6 +48,8 @@
typedef point psite;
typedef Ps pset;
+ typedef typename point::coord coord;
+
typedef T value;
typedef const T& rvalue;
Index: oln/core/internal/window_base.hh
--- oln/core/internal/window_base.hh (revision 0)
+++ oln/core/internal/window_base.hh (revision 0)
@@ -0,0 +1,96 @@
+// Copyright (C) 2007 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_INTERNAL_WINDOW_BASE_HH
+# define OLN_CORE_INTERNAL_WINDOW_BASE_HH
+
+# include <oln/core/concept/window.hh>
+
+
+namespace oln
+{
+
+
+ // Fwd decl.
+ namespace internal { template <typename Exact> class window_base_; }
+
+
+ // Super type.
+ template <typename Exact>
+ struct super_trait_< internal::window_base_<Exact> >
+ {
+ typedef Window<Exact> ret;
+ };
+
+
+ /// Virtual types.
+ template <typename Exact>
+ struct vtypes< internal::window_base_<Exact> >
+ {
+ typedef stc::abstract point;
+ typedef stc::abstract fwd_qiter;
+ typedef stc::abstract bkd_qiter;
+
+ typedef stc_deferred(point) point__;
+ typedef stc_deferred(fwd_qiter) fwd_qiter__;
+
+ typedef stc::final< stc_type(point__, grid) > grid;
+ typedef stc::final< fwd_qiter__ > qiter;
+ };
+
+
+ namespace internal
+ {
+
+ /// Base class for implementation of windows class.
+
+ template <typename Exact>
+ class window_base_ : public Window<Exact>
+ {
+ protected:
+ window_base_();
+
+ }; // end of class oln::window_base_<Exact>
+
+
+
+# ifndef OLN_INCLUDE_ONLY
+
+ template <typename Exact>
+ window_base_<Exact>::window_base_()
+ {
+ }
+
+# endif
+
+
+ } // end of namespace oln::internal
+
+} // end of namespace oln
+
+
+#endif // ! OLN_CORE_INTERNAL_WINDOW_BASE_HH
Index: oln/core/internal/neighborhood_base.hh
--- oln/core/internal/neighborhood_base.hh (revision 0)
+++ oln/core/internal/neighborhood_base.hh (revision 0)
@@ -0,0 +1,92 @@
+// Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007 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_INTERNAL_NEIGHBORHOOD_BASE_HH
+# define OLN_CORE_INTERNAL_NEIGHBORHOOD_BASE_HH
+
+# include <oln/core/concept/neighborhood.hh>
+
+
+namespace oln
+{
+
+
+ // Fwd decl.
+ namespace internal { template <typename Exact> class neighborhood_base_; }
+
+
+ // Super type.
+ template <typename Exact>
+ struct super_trait_< internal::neighborhood_base_<Exact> >
+ {
+ typedef Neighborhood<Exact> ret;
+ };
+
+
+ /// Virtual types.
+ template <typename Exact>
+ struct vtypes< internal::neighborhood_base_<Exact> >
+ {
+ typedef stc::abstract point;
+
+ typedef stc_deferred(point) point__;
+ typedef stc::final< stc_type(point__, grid) > grid;
+ };
+
+
+ namespace internal
+ {
+
+ /// Base class for implementation of neighborhoods class.
+
+ template <typename Exact>
+ class neighborhood_base_ : public Neighborhood< neighb_<Exact> >
+ {
+ protected:
+ neighborhood_base_();
+
+ }; // end of class oln::neighborhood_base_<Exact>
+
+
+
+# ifndef OLN_INCLUDE_ONLY
+
+ template <typename Exact>
+ neighborhood_base_<Exact>::neighborhood_base_()
+ {
+ }
+
+# endif
+
+
+ } // end of namespace oln::internal
+
+} // end of namespace oln
+
+
+#endif // ! OLN_CORE_INTERNAL_NEIGHBORHOOD_BASE_HH
Index: oln/core/internal/point_set_std_based.hh
--- oln/core/internal/point_set_std_based.hh (revision 857)
+++ oln/core/internal/point_set_std_based.hh (working copy)
@@ -109,6 +109,7 @@
for_all(i)
ostr << i.to_point() << ' ';
ostr << "}";
+ return ostr;
}
Index: oln/core/internal/image_base.hh
--- oln/core/internal/image_base.hh (revision 857)
+++ oln/core/internal/image_base.hh (working copy)
@@ -33,7 +33,6 @@
# include <oln/core/internal/utils.hh>
# include <oln/core/gen/box.hh>
# include <oln/core/gen/image_pset_piter.hh>
-# include <oln/core/gen/dpoints_piter.hh>
@@ -140,9 +139,6 @@
typedef stc_deferred(point) point__;
typedef stc::final< point__ > psite;
- typedef stc::final< dpoints_fwd_piter_<point__> > fwd_qiter;
- typedef stc::final< dpoints_bkd_piter_<point__> > bkd_qiter;
- typedef fwd_qiter qiter;
};
template <typename Exact>
Index: oln/core/internal/point2d.hh
--- oln/core/internal/point2d.hh (revision 857)
+++ oln/core/internal/point2d.hh (working copy)
@@ -64,9 +64,9 @@
class point2d_ : public point_base_<Exact>
{
typedef point_base_<Exact> super;
- stc_using(coord);
public:
+ stc_using(coord);
coord row() const;
coord& row();