Commit a4fff6b3 authored by Thierry Geraud's avatar Thierry Geraud
Browse files

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

	Add computability image hierarchy.
	
	* oln/core/abstract/image/computability: New.
	* oln/core/abstract/image/computability/hierarchy.hh: New.
	* oln/core/typedefs.hh (is_computed_type): New.
	* oln/core/image_entry.hh (is_computed_type): New in vtypes.
	* oln/core/abstract/image.hh (decl): Update.
	* oln/core/abstract/image/hierarchies.hh
	(image_hierarchy_wrt_computability): New.
	(hierarchy): Update ids.
	* oln/core/abstract/image/all.hh
	(include): Add computability/hierarchy.hh.
	* oln/core/1d/image1d.hh: Update.
	* oln/core/2d/image2d.hh: Likewise.
	* oln/core/3d/image3d.hh: Likewise.
	* oln/core/gen/mapimage.hh: Likewise.
	* oln/morpher/value_cast.hh: Likewise.
	* oln/morpher/thru_fun.hh: Likewise.
	* oln/morpher/internal/image_value_morpher.hh: Likewise.



git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@651 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent 274aeb4b
2006-10-17 Thierry GERAUD <theo@tegucigalpa.lrde.epita.fr>
Add computability image hierarchy.
* oln/core/abstract/image/computability: New.
* oln/core/abstract/image/computability/hierarchy.hh: New.
* oln/core/typedefs.hh (is_computed_type): New.
* oln/core/image_entry.hh (is_computed_type): New in vtypes.
* oln/core/abstract/image.hh (decl): Update.
* oln/core/abstract/image/hierarchies.hh
(image_hierarchy_wrt_computability): New.
(hierarchy): Update ids.
* oln/core/abstract/image/all.hh
(include): Add computability/hierarchy.hh.
* oln/core/1d/image1d.hh: Update.
* oln/core/2d/image2d.hh: Likewise.
* oln/core/3d/image3d.hh: Likewise.
* oln/core/gen/mapimage.hh: Likewise.
* oln/morpher/value_cast.hh: Likewise.
* oln/morpher/thru_fun.hh: Likewise.
* oln/morpher/internal/image_value_morpher.hh: Likewise.
2006-10-17 Thierry GERAUD <theo@tegucigalpa.lrde.epita.fr> 2006-10-17 Thierry GERAUD <theo@tegucigalpa.lrde.epita.fr>
Adjust lvalue so that it handles a '&' when needed. Adjust lvalue so that it handles a '&' when needed.
......
...@@ -58,6 +58,7 @@ namespace oln ...@@ -58,6 +58,7 @@ namespace oln
typedef point1d point_type; typedef point1d point_type;
typedef mlc::false_ is_computed_type;
typedef T value_type; typedef T value_type;
typedef T& lvalue_type; typedef T& lvalue_type;
typedef mlc::true_ is_mutable_type; typedef mlc::true_ is_mutable_type;
......
...@@ -58,6 +58,7 @@ namespace oln ...@@ -58,6 +58,7 @@ namespace oln
typedef point2d point_type; typedef point2d point_type;
typedef mlc::false_ is_computed_type;
typedef T value_type; typedef T value_type;
typedef T& lvalue_type; typedef T& lvalue_type;
typedef mlc::true_ is_mutable_type; typedef mlc::true_ is_mutable_type;
......
...@@ -58,6 +58,7 @@ namespace oln ...@@ -58,6 +58,7 @@ namespace oln
typedef point3d point_type; typedef point3d point_type;
typedef mlc::false_ is_computed_type;
typedef T value_type; typedef T value_type;
typedef T& lvalue_type; typedef T& lvalue_type;
typedef mlc::true_ is_mutable_type; typedef mlc::true_ is_mutable_type;
......
...@@ -75,6 +75,8 @@ namespace oln ...@@ -75,6 +75,8 @@ namespace oln
// // oln_virtual_typedef(fwd_piter); // // oln_virtual_typedef(fwd_piter);
// // oln_virtual_typedef(bkd_piter); // // oln_virtual_typedef(bkd_piter);
oln_virtual_typedef(is_computed);
// oln_virtual_typedef(value); // oln_virtual_typedef(value);
// oln_virtual_typedef(rvalue); // oln_virtual_typedef(rvalue);
......
...@@ -44,7 +44,10 @@ ...@@ -44,7 +44,10 @@
# include <oln/core/abstract/image/accessibility/hierarchy.hh> # include <oln/core/abstract/image/accessibility/hierarchy.hh>
// Hierarchy 6: image w.r.t. data mutability. // Hierarchy 6: image w.r.t. data mutability.
# include <oln/core/abstract/image/mutability/hierarchy.hh> # include <oln/core/abstract/image/mutability/hierarchy.hh>
// Hybrid hierarchy 7: image w.r.t. classical features. // Hierarchy 7: image w.r.t. computability.
# include <oln/core/abstract/image/computability/hierarchy.hh>
// Hybrid hierarchy 8: image w.r.t. classical features.
# include <oln/core/abstract/image/hybrid/classical.hh> # include <oln/core/abstract/image/hybrid/classical.hh>
#endif // ! OLN_CORE_ABSTRACT_IMAGE_ALL_HH #endif // ! OLN_CORE_ABSTRACT_IMAGE_ALL_HH
// Copyright (C) 2006 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
// of the GNU General Public License version 2 as published by the
// Free Software Foundation.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; see the file COPYING. If not, write to
// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
// Boston, MA 02111-1307, USA.
//
// As a special exception, you may use this file as part of a free
// software library without restriction. Specifically, if other files
// instantiate templates or use macros or inline functions from this
// file, or you compile this file and link it with other files to
// produce an executable, this file does not by itself cause the
// resulting executable to be covered by the GNU General Public
// License. This exception does not however invalidate any other
// reasons why the executable file might be covered by the GNU General
// Public License.
#ifndef OLN_CORE_ABSTRACT_IMAGE_COMPUTABILITY_HIERARCHY_HH
# define OLN_CORE_ABSTRACT_IMAGE_COMPUTABILITY_HIERARCHY_HH
# include <oln/core/abstract/image.hh>
# include <oln/core/abstract/image/hierarchies.hh>
// # include <oln/core/automatic/image/computed_image.hh>
// # include <oln/core/automatic/image/plain_image.hh>
namespace oln
{
/*--------------.
| Abstraction. |
`---------------*/
namespace abstract
{
/// Image whose data are computed.
template <typename E>
struct computed_image :
public virtual image<E> //, public automatic::get_impl< computed_image, E>
{
protected:
/// Constructor (protected, empty).
computed_image();
};
/// Image whose data are *not* computed so they are *plain*.
template <typename E>
struct plain_image :
public virtual image<E> //, public automatic::get_impl< plain_image, E>
{
protected:
/// Constructor (protected, empty).
plain_image();
};
# ifndef OLN_INCLUDE_ONLY
template <typename E>
computed_image<E>::computed_image()
{
}
template <typename E>
plain_image<E>::plain_image()
{
}
# endif
} // end of namespace oln::abstract
/*--------------------.
| Computability switch. |
`--------------------*/
/// With computability.
template <typename E>
struct case_< image_hierarchy_wrt_computability, E, 1 > :
where_< mlc::eq_< oln_type_of(E, is_computed), mlc::true_ > >
{
typedef abstract::computed_image<E> ret;
};
template <typename E>
struct case_< image_hierarchy_wrt_computability, E, 2 > :
where_< mlc::eq_< oln_type_of(E, is_computed), mlc::false_ > >
{
typedef abstract::plain_image<E> ret;
};
} // end of namespace oln
#endif // ! OLN_CORE_ABSTRACT_IMAGE_COMPUTABILITY_HIERARCHY_HH
...@@ -40,13 +40,14 @@ namespace oln ...@@ -40,13 +40,14 @@ namespace oln
typedef hierarchy<abstract::image, 4> image_hierarchy_wrt_bbox; typedef hierarchy<abstract::image, 4> image_hierarchy_wrt_bbox;
typedef hierarchy<abstract::image, 5> image_hierarchy_wrt_accessibility; typedef hierarchy<abstract::image, 5> image_hierarchy_wrt_accessibility;
typedef hierarchy<abstract::image, 6> image_hierarchy_wrt_mutability; typedef hierarchy<abstract::image, 6> image_hierarchy_wrt_mutability;
typedef hierarchy<abstract::image, 7> image_hierarchy_wrt_computability;
typedef hierarchy<abstract::image, 7> image_hybrid_hierarchy_wrt_classical; typedef hierarchy<abstract::image, 8> image_hybrid_hierarchy_wrt_classical;
// FIXME: To be continued. // FIXME: To be continued.
#if 0 #if 0
typedef hierarchy<abstract::image, 8> image_hierarchy_wrt_value; typedef hierarchy<abstract::image, 9> image_hierarchy_wrt_value;
typedef hierarchy<abstract::image, 9> image_hierarchy_wrt_data_retrieval; typedef hierarchy<abstract::image, 10> image_hierarchy_wrt_data_retrieval;
// ... // ...
#endif #endif
......
...@@ -55,6 +55,7 @@ namespace oln ...@@ -55,6 +55,7 @@ namespace oln
typedef fwd_piter_bbox_<topo_type> fwd_piter_type; typedef fwd_piter_bbox_<topo_type> fwd_piter_type;
typedef bkd_piter_bbox_<topo_type> bkd_piter_type; typedef bkd_piter_bbox_<topo_type> bkd_piter_type;
typedef mlc::false_ is_computed_type;
typedef value_t value_type; typedef value_t value_type;
typedef mlc::true_ is_mutable_type; typedef mlc::true_ is_mutable_type;
......
...@@ -71,6 +71,8 @@ namespace oln ...@@ -71,6 +71,8 @@ namespace oln
// psite_type: see below. // psite_type: see below.
typedef mlc::undefined point_type; typedef mlc::undefined point_type;
typedef mlc::undefined is_computed_type;
typedef mlc::undefined value_type; typedef mlc::undefined value_type;
// rvalue_type: see below. // rvalue_type: see below.
......
...@@ -123,6 +123,7 @@ namespace oln ...@@ -123,6 +123,7 @@ namespace oln
// -------------------------------------------------------------------- // --------------------------------------------------------------------
// mlc_decl_typedef(data_type); // mlc_decl_typedef(data_type);
// -------------------------------------------------------------------- // --------------------------------------------------------------------
mlc_decl_typedef(is_computed_type);
mlc_decl_typedef(value_type); mlc_decl_typedef(value_type);
mlc_decl_typedef(rvalue_type); mlc_decl_typedef(rvalue_type);
mlc_decl_typedef(lvalue_type); mlc_decl_typedef(lvalue_type);
......
...@@ -64,8 +64,11 @@ namespace oln ...@@ -64,8 +64,11 @@ namespace oln
{ {
// Morpher type. // Morpher type.
typedef oln::morpher::tag::identity morpher_type; // FIXME: Wrong! typedef oln::morpher::tag::identity morpher_type; // FIXME: Wrong!
typedef mlc::undefined is_computed_type;
typedef mlc::undefined lvalue_type; typedef mlc::undefined lvalue_type;
typedef mlc::undefined value_type; typedef mlc::undefined value_type;
typedef mlc::undefined is_mutable_type;
}; };
template <typename Image, typename Exact> template <typename Image, typename Exact>
......
...@@ -59,7 +59,8 @@ namespace oln ...@@ -59,7 +59,8 @@ namespace oln
{ {
private: private:
typedef oln_type_of(Image, rvalue) old_value_type; typedef oln_type_of(Image, rvalue) old_value_type;
public: public:
typedef mlc::true_ is_computed_type;
typedef xtd_res_1(Fun, old_value_type) value_type; typedef xtd_res_1(Fun, old_value_type) value_type;
typedef mlc::false_ is_mutable_type; typedef mlc::false_ is_mutable_type;
}; };
......
...@@ -57,6 +57,7 @@ namespace oln ...@@ -57,6 +57,7 @@ namespace oln
template <typename Image, typename Value> template <typename Image, typename Value>
struct vtypes< morpher::value_cast<Image, Value> > struct vtypes< morpher::value_cast<Image, Value> >
{ {
typedef mlc::true_ is_computed_type;
typedef Value value_type; typedef Value value_type;
typedef mlc::false_ is_mutable_type; typedef mlc::false_ is_mutable_type;
}; };
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment