
2006-10-17 Thierry GERAUD <theo@tegucigalpa.lrde.epita.fr> Adjust lvalue so that it handles a '&' when needed. * oln/core/automatic/image/image1d.hh (impl_at): Adjust. * oln/core/automatic/image/image2d.hh: Likewise. * oln/core/automatic/image/image3d.hh: Likewise. * oln/core/automatic/image/image_being_mutable.hh: Likewise. * oln/core/abstract/image/mutability/hierarchy.hh: Likewise. * oln/core/abstract/image/dimension/1d.hh: Likewise. * oln/core/abstract/image/dimension/2d.hh: Likewise. * oln/core/abstract/image/dimension/3d.hh: Likewise. * oln/core/1d/image1d.hh: Likewise. * oln/core/2d/image2d.hh: Likewise. * oln/core/3d/image3d.hh: Likewise. * oln/core/gen/mapimage.hh: Likewise. * oln/core/abstract/image/type/integre.hh: Fix case number wrt those defined in hierarchy.hh. Index: oln/core/automatic/image/image1d.hh =================================================================== --- oln/core/automatic/image/image1d.hh (revision 649) +++ oln/core/automatic/image/image1d.hh (working copy) @@ -58,7 +58,7 @@ oln_rvalue(E) impl_at(const oln_coord(E)& index) const; // FIXME: Hack. - oln_lvalue(E)& impl_at(const oln_coord(E)& index); + oln_lvalue(E) impl_at(const oln_coord(E)& index); bool impl_has_at(const oln_coord(E)& index) const; }; @@ -76,7 +76,7 @@ oln_rvalue(E) impl_at(const oln_coord(E)& index) const; // FIXME: Hack. - oln_lvalue(E)& impl_at(const oln_coord(E)& index); + oln_lvalue(E) impl_at(const oln_coord(E)& index); bool impl_has_at(const oln_coord(E)& index) const; }; @@ -98,7 +98,7 @@ } template <typename E, typename tag> - oln_lvalue(E)& + oln_lvalue(E) set_impl<abstract::image1d, tag, E> ::impl_at(const oln_coord(E)& index) { @@ -127,7 +127,7 @@ } template <typename E> - oln_lvalue(E)& + oln_lvalue(E) set_impl<abstract::image1d, morpher::tag::identity, E> ::impl_at(const oln_coord(E)& index) { Index: oln/core/automatic/image/image2d.hh =================================================================== --- oln/core/automatic/image/image2d.hh (revision 649) +++ oln/core/automatic/image/image2d.hh (working copy) @@ -58,7 +58,7 @@ oln_rvalue(E) impl_at(const oln_coord(E)& row, const oln_coord(E)& col) const; // FIXME: Hack. - oln_lvalue(E)& impl_at(const oln_coord(E)& row, const oln_coord(E)& col); + oln_lvalue(E) impl_at(const oln_coord(E)& row, const oln_coord(E)& col); bool impl_has_at(const oln_coord(E)& row, const oln_coord(E)& col) const; }; @@ -76,7 +76,7 @@ oln_rvalue(E) impl_at(const oln_coord(E)& row, const oln_coord(E)& col) const; // FIXME: Hack. - oln_lvalue(E)& impl_at(const oln_coord(E)& row, const oln_coord(E)& col); + oln_lvalue(E) impl_at(const oln_coord(E)& row, const oln_coord(E)& col); bool impl_has_at(const oln_coord(E)& row, const oln_coord(E)& col) const; }; @@ -98,7 +98,7 @@ } template <typename E, typename tag> - oln_lvalue(E)& + oln_lvalue(E) set_impl<abstract::image2d, tag, E> ::impl_at(const oln_coord(E)& row, const oln_coord(E)& col) { @@ -127,7 +127,7 @@ } template <typename E> - oln_lvalue(E)& + oln_lvalue(E) set_impl<abstract::image2d, morpher::tag::identity, E> ::impl_at(const oln_coord(E)& row, const oln_coord(E)& col) { Index: oln/core/automatic/image/image3d.hh =================================================================== --- oln/core/automatic/image/image3d.hh (revision 649) +++ oln/core/automatic/image/image3d.hh (working copy) @@ -60,9 +60,9 @@ const oln_coord(E)& col) const; // FIXME: Hack. - oln_lvalue(E)& impl_at(const oln_coord(E)& slice, - const oln_coord(E)& row, - const oln_coord(E)& col); + oln_lvalue(E) impl_at(const oln_coord(E)& slice, + const oln_coord(E)& row, + const oln_coord(E)& col); bool impl_has_at(const oln_coord(E)& slice, const oln_coord(E)& row, const oln_coord(E)& col) const; @@ -84,9 +84,9 @@ const oln_coord(E)& col) const; // FIXME: Hack. - oln_lvalue(E)& impl_at(const oln_coord(E)& slice, - const oln_coord(E)& row, - const oln_coord(E)& col); + oln_lvalue(E) impl_at(const oln_coord(E)& slice, + const oln_coord(E)& row, + const oln_coord(E)& col); bool impl_has_at(const oln_coord(E)& slice, const oln_coord(E)& row, const oln_coord(E)& col) const; @@ -112,7 +112,7 @@ } template <typename E, typename tag> - oln_lvalue(E)& + oln_lvalue(E) set_impl<abstract::image3d, tag, E> ::impl_at(const oln_coord(E)& slice, const oln_coord(E)& row, @@ -147,7 +147,7 @@ } template <typename E> - oln_lvalue(E)& + oln_lvalue(E) set_impl<abstract::image3d, morpher::tag::identity, E> ::impl_at(const oln_coord(E)& slice, const oln_coord(E)& row, Index: oln/core/automatic/image/image_being_mutable.hh =================================================================== --- oln/core/automatic/image/image_being_mutable.hh (revision 649) +++ oln/core/automatic/image/image_being_mutable.hh (working copy) @@ -52,13 +52,13 @@ { public: /// Accessor delegation. - oln_lvalue(E)& impl_op_readwrite(const oln_psite(E)& p); + oln_lvalue(E) impl_op_readwrite(const oln_psite(E)& p); }; # ifndef OLN_INCLUDE_ONLY template <typename E> - oln_lvalue(E)& + oln_lvalue(E) set_impl<abstract::image_being_mutable, morpher::tag::identity, E> ::impl_op_readwrite(const oln_psite(E)& p) { Index: oln/core/abstract/image/type/integre.hh =================================================================== --- oln/core/abstract/image/type/integre.hh (revision 649) +++ oln/core/abstract/image/type/integre.hh (working copy) @@ -96,7 +96,7 @@ /// Binary case. template <typename E> - struct case_< image_hierarchy_wrt_type, E, 3 > : + struct case_< image_hierarchy_wrt_type, E, 5 > : where_< mlc::or_list_< mlc::eq_<oln_type_of(E, value), ntg::bin>, ntg::eq_<ntg::int_u, 1, oln_type_of(E, value)>, ntg::eq_<ntg::int_s, 1, oln_type_of(E, value)> > > @@ -107,7 +107,7 @@ /// Grey-level case. template <typename E> - struct case_< image_hierarchy_wrt_type, E, 4 > : + struct case_< image_hierarchy_wrt_type, E, 6 > : where_< mlc_is_a( oln_type_of(E, value), ntg::real_value ) > { // Definition of the super class corresponding to this case @@ -118,7 +118,7 @@ /// Label case. template <typename E> - struct case_< image_hierarchy_wrt_type, E, 5 > : + struct case_< image_hierarchy_wrt_type, E, 7 > : where_< mlc_is_a( oln_type_of(E, value), ntg::enum_value ) > { // Definition of the super class corresponding to this case @@ -129,7 +129,7 @@ /// Color case. template <typename E> - struct case_< image_hierarchy_wrt_type, E, 6 > : + struct case_< image_hierarchy_wrt_type, E, 8 > : where_< mlc_is_a( oln_type_of(E, value), ntg::color_value ) > { // Definition of the super class corresponding to this case Index: oln/core/abstract/image/mutability/hierarchy.hh =================================================================== --- oln/core/abstract/image/mutability/hierarchy.hh (revision 649) +++ oln/core/abstract/image/mutability/hierarchy.hh (working copy) @@ -68,7 +68,7 @@ using image<E>::operator(); - lvalue_t& operator()(const psite_t& p); + lvalue_t operator()(const psite_t& p); protected: @@ -84,7 +84,7 @@ # ifndef OLN_INCLUDE_ONLY template <typename E> - typename image_being_mutable<E>::lvalue_t& + typename image_being_mutable<E>::lvalue_t image_being_mutable<E>::operator()(const typename image_being_mutable<E>::psite_t& p) { return this->exact().impl_op_readwrite(p); Index: oln/core/abstract/image/dimension/1d.hh =================================================================== --- oln/core/abstract/image/dimension/1d.hh (revision 649) +++ oln/core/abstract/image/dimension/1d.hh (working copy) @@ -49,7 +49,7 @@ oln_rvalue(E) at(const oln_coord(E)& index) const; // FIXME: Hack (should be elsewhere)! - oln_lvalue(E)& at(const oln_coord(E)& index); + oln_lvalue(E) at(const oln_coord(E)& index); bool has_at(const oln_coord(E)& index) const; protected: @@ -73,7 +73,7 @@ } template <typename E> - oln_lvalue(E)& + oln_lvalue(E) image1d<E>::at(const oln_coord(E)& index) { return this->exact().impl_at(index); Index: oln/core/abstract/image/dimension/2d.hh =================================================================== --- oln/core/abstract/image/dimension/2d.hh (revision 649) +++ oln/core/abstract/image/dimension/2d.hh (working copy) @@ -49,7 +49,7 @@ oln_rvalue(E) at(const oln_coord(E)& row, const oln_coord(E)& col) const; // FIXME: Hack (should be elsewhere)! - oln_lvalue(E)& at(const oln_coord(E)& row, const oln_coord(E)& col); + oln_lvalue(E) at(const oln_coord(E)& row, const oln_coord(E)& col); bool has_at(const oln_coord(E)& row, const oln_coord(E)& col) const; protected: @@ -73,7 +73,7 @@ } template <typename E> - oln_lvalue(E)& + oln_lvalue(E) image2d<E>::at(const oln_coord(E)& row, const oln_coord(E)& col) { return this->exact().impl_at(row, col); Index: oln/core/abstract/image/dimension/3d.hh =================================================================== --- oln/core/abstract/image/dimension/3d.hh (revision 649) +++ oln/core/abstract/image/dimension/3d.hh (working copy) @@ -51,9 +51,9 @@ const oln_coord(E)& col) const; // FIXME: Hack (should be elsewhere)! - oln_lvalue(E)& at(const oln_coord(E)& slice, - const oln_coord(E)& row, - const oln_coord(E)& col); + oln_lvalue(E) at(const oln_coord(E)& slice, + const oln_coord(E)& row, + const oln_coord(E)& col); bool has_at(const oln_coord(E)& slice, const oln_coord(E)& row, const oln_coord(E)& col) const; @@ -81,7 +81,7 @@ } template <typename E> - oln_lvalue(E)& + oln_lvalue(E) image3d<E>::at(const oln_coord(E)& slice, const oln_coord(E)& row, const oln_coord(E)& col) Index: oln/core/1d/image1d.hh =================================================================== --- oln/core/1d/image1d.hh (revision 649) +++ oln/core/1d/image1d.hh (working copy) @@ -59,7 +59,7 @@ typedef point1d point_type; typedef T value_type; - typedef T lvalue_type; + typedef T& lvalue_type; typedef mlc::true_ is_mutable_type; typedef image1d<T> real_type; Index: oln/core/2d/image2d.hh =================================================================== --- oln/core/2d/image2d.hh (revision 649) +++ oln/core/2d/image2d.hh (working copy) @@ -59,7 +59,7 @@ typedef point2d point_type; typedef T value_type; - typedef T lvalue_type; + typedef T& lvalue_type; typedef mlc::true_ is_mutable_type; typedef image2d<T> real_type; Index: oln/core/3d/image3d.hh =================================================================== --- oln/core/3d/image3d.hh (revision 649) +++ oln/core/3d/image3d.hh (working copy) @@ -59,7 +59,7 @@ typedef point3d point_type; typedef T value_type; - typedef T lvalue_type; + typedef T& lvalue_type; typedef mlc::true_ is_mutable_type; typedef image3d<T> real_type; Index: oln/core/gen/mapimage.hh =================================================================== --- oln/core/gen/mapimage.hh (revision 649) +++ oln/core/gen/mapimage.hh (working copy) @@ -58,7 +58,7 @@ typedef value_t value_type; typedef mlc::true_ is_mutable_type; - typedef value_t lvalue_type; + typedef value_t& lvalue_type; typedef void real_type; // FIXME };