URL:
https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2007-10-04 Matthieu Garrigues <garrigues(a)lrde.epita.fr>
Change accumulators inheritance.
* mln/accu/bbox.hh,
* mln/accu/count.hh,
* mln/accu/histo.hh,
* mln/accu/max.hh,
* mln/accu/max_h.hh,
* mln/accu/mean.hh,
* mln/accu/min.hh,
* mln/accu/min_h.hh,
* mln/accu/nil.hh,
* mln/accu/p.hh,
* mln/accu/pair.hh,
* mln/accu/sum.hh,
* mln/accu/v.hh: Update inheritances (from Accumulator to base_).
---
bbox.hh | 4 ++--
count.hh | 3 ++-
histo.hh | 4 ++--
max.hh | 2 +-
max_h.hh | 4 ++--
mean.hh | 3 ++-
min.hh | 3 ++-
min_h.hh | 4 ++--
nil.hh | 3 ++-
p.hh | 4 +++-
pair.hh | 4 +++-
sum.hh | 4 +++-
v.hh | 4 ++--
13 files changed, 28 insertions(+), 18 deletions(-)
Index: trunk/milena/mln/accu/nil.hh
===================================================================
--- trunk/milena/mln/accu/nil.hh (revision 1236)
+++ trunk/milena/mln/accu/nil.hh (revision 1237)
@@ -37,6 +37,7 @@
# include <mln/core/concept/meta_accumulator.hh>
# include <mln/core/concept/accumulator.hh>
+# include <mln/accu/internal/base.hh>
# include <mln/util/eat.hh>
# include <mln/util/ignore.hh>
@@ -50,7 +51,7 @@
/*! Define an accumulator that does nothing.
*/
template <typename T>
- struct nil_ : public Accumulator< nil_<T> >
+ struct nil_ : public mln::accu::internal::base_< util::ignore , nil_<T>
>
{
typedef util::eat value;
typedef util::ignore result;
Index: trunk/milena/mln/accu/min.hh
===================================================================
--- trunk/milena/mln/accu/min.hh (revision 1236)
+++ trunk/milena/mln/accu/min.hh (revision 1237)
@@ -33,6 +33,7 @@
* \brief Define an accumulator that computes a min.
*/
+# include <mln/accu/internal/base.hh>
# include <mln/core/concept/meta_accumulator.hh>
# include <mln/value/props.hh>
# include <mln/util/pix.hh>
@@ -50,7 +51,7 @@
* The parameter \c V is the type of values.
*/
template <typename V>
- struct min_ : public Accumulator< min_<V> >
+ struct min_ : public mln::accu::internal::base_< V, min_<V> >
{
typedef V value;
typedef V result;
Index: trunk/milena/mln/accu/max.hh
===================================================================
--- trunk/milena/mln/accu/max.hh (revision 1236)
+++ trunk/milena/mln/accu/max.hh (revision 1237)
@@ -50,7 +50,7 @@
* The parameter \c V is the type of values.
*/
template <typename V>
- struct max_ : public Accumulator< max_<V> >
+ struct max_ : public mln::accu::internal::base_< V , max_<V> >
{
typedef V value;
typedef V result;
Index: trunk/milena/mln/accu/histo.hh
===================================================================
--- trunk/milena/mln/accu/histo.hh (revision 1236)
+++ trunk/milena/mln/accu/histo.hh (revision 1237)
@@ -39,7 +39,7 @@
# include <algorithm>
# include <mln/core/concept/value_set.hh>
-# include <mln/core/concept/accumulator.hh>
+# include <mln/accu/internal/base.hh>
# include <mln/value/set.hh>
@@ -53,7 +53,7 @@
/*! Generic histogram class over a value set with type \c S.
*/
template <typename S>
- struct histo : public Accumulator< histo<S> >
+ struct histo : public mln::accu::internal::base_< const
std::vector<std::size_t>& , histo<S> >
{
histo(const Value_Set<S>& s);
histo();
Index: trunk/milena/mln/accu/count.hh
===================================================================
--- trunk/milena/mln/accu/count.hh (revision 1236)
+++ trunk/milena/mln/accu/count.hh (revision 1237)
@@ -33,6 +33,7 @@
* \brief Define an accumulator that counts.
*/
+# include <mln/accu/internal/base.hh>
# include <mln/core/concept/meta_accumulator.hh>
@@ -46,7 +47,7 @@
/*! Generic counter accumulator class.
*/
template <typename V>
- struct count_ : public Accumulator< count_<V> >
+ struct count_ : public mln::accu::internal::base_< std::size_t , count_<V>
>
{
typedef V value;
typedef std::size_t result; // FIXME: Up in Accumulator.
Index: trunk/milena/mln/accu/bbox.hh
===================================================================
--- trunk/milena/mln/accu/bbox.hh (revision 1236)
+++ trunk/milena/mln/accu/bbox.hh (revision 1237)
@@ -33,7 +33,7 @@
* \brief Define an accumulator that computes a bbox.
*/
-# include <mln/core/concept/accumulator.hh>
+# include <mln/accu/internal/base.hh>
# include <mln/core/box.hh>
@@ -49,7 +49,7 @@
* The parameter \c P is the type of points.
*/
template <typename P>
- struct bbox : public Accumulator< bbox<P> >
+ struct bbox : public mln::accu::internal::base_< const box_<P>& ,
bbox<P> >
{
typedef P value;
typedef const box_<P>& result;
Index: trunk/milena/mln/accu/min_h.hh
===================================================================
--- trunk/milena/mln/accu/min_h.hh (revision 1236)
+++ trunk/milena/mln/accu/min_h.hh (revision 1237)
@@ -33,7 +33,7 @@
* \brief Define a generic min accumulator class based on histogram.
*/
-# include <mln/core/concept/accumulator.hh>
+# include <mln/accu/internal/base.hh>
# include <mln/accu/histo.hh>
@@ -48,7 +48,7 @@
* type \c S.
*/
template <typename S>
- struct min_h : public Accumulator< min_h<S> >
+ struct min_h : public mln::accu::internal::base_< mln_value(S) , min_h<S>
>
{
typedef mln_value(S) value;
typedef value result;
Index: trunk/milena/mln/accu/pair.hh
===================================================================
--- trunk/milena/mln/accu/pair.hh (revision 1236)
+++ trunk/milena/mln/accu/pair.hh (revision 1237)
@@ -36,6 +36,8 @@
# include <utility>
# include <mln/core/concept/meta_accumulator.hh>
+
+# include <mln/accu/internal/base.hh>
# include <mln/metal/is_a.hh>
# include <mln/metal/unqualif.hh>
@@ -54,7 +56,7 @@
* \todo Check that, when V is not provided, A1 and A2 have the same value.
*/
template <typename A1, typename A2, typename V = mln_value(A1)>
- struct pair_ : public Accumulator< pair_<A1,A2,V> >
+ struct pair_ : public mln::accu::internal::base_< std::pair<
mlc_unqualif(mln_result(A1)) , mlc_unqualif(mln_result(A2)) > , pair_<A1,A2,V>
>
{
typedef V value;
Index: trunk/milena/mln/accu/max_h.hh
===================================================================
--- trunk/milena/mln/accu/max_h.hh (revision 1236)
+++ trunk/milena/mln/accu/max_h.hh (revision 1237)
@@ -33,7 +33,7 @@
* \brief Define a generic max accumulator class based on histogram.
*/
-# include <mln/core/concept/accumulator.hh>
+# include <mln/accu/internal/base.hh>
# include <mln/accu/histo.hh>
@@ -48,7 +48,7 @@
* type \c S.
*/
template <typename S>
- struct max_h : public Accumulator< max_h<S> >
+ struct max_h : public mln::accu::internal::base_< mln_value(S) , max_h<S>
>
{
typedef mln_value(S) value;
typedef value result;
Index: trunk/milena/mln/accu/p.hh
===================================================================
--- trunk/milena/mln/accu/p.hh (revision 1236)
+++ trunk/milena/mln/accu/p.hh (revision 1237)
@@ -35,6 +35,8 @@
# include <mln/core/concept/meta_accumulator.hh>
# include <mln/core/concept/accumulator.hh>
+
+# include <mln/accu/internal/base.hh>
# include <mln/metal/is_a.hh>
@@ -50,7 +52,7 @@
* The parameter \c V is the type of values.
*/
template <typename A>
- struct p_ : public Accumulator< p_<A> >
+ struct p_ : public mln::accu::internal::base_< mln_result(A) , p_<A> >
{
typedef mln_value(A) value;
typedef mln_result(A) result;
Index: trunk/milena/mln/accu/sum.hh
===================================================================
--- trunk/milena/mln/accu/sum.hh (revision 1236)
+++ trunk/milena/mln/accu/sum.hh (revision 1237)
@@ -34,6 +34,8 @@
*/
# include <mln/core/concept/meta_accumulator.hh>
+
+# include <mln/accu/internal/base.hh>
# include <mln/value/props.hh>
# include <mln/util/pix.hh>
# include <mln/literal/zero.hh>
@@ -53,7 +55,7 @@
* \c S is the summation type (property) of \c V.
*/
template <typename V, typename S = mln_sum(V)>
- struct sum_ : public Accumulator< sum_<V,S> >
+ struct sum_ : public mln::accu::internal::base_< S, sum_<V,S> >
{
typedef V value;
typedef S result;
Index: trunk/milena/mln/accu/v.hh
===================================================================
--- trunk/milena/mln/accu/v.hh (revision 1236)
+++ trunk/milena/mln/accu/v.hh (revision 1237)
@@ -34,7 +34,7 @@
*/
# include <mln/core/concept/meta_accumulator.hh>
-# include <mln/core/concept/accumulator.hh>
+# include <mln/accu/internal/base.hh>
# include <mln/metal/is_a.hh>
@@ -48,7 +48,7 @@
/*! Generic v of accumulators.
*/
template <typename A>
- struct val_ : public Accumulator< val_<A> >
+ struct val_ : public mln::accu::internal::base_< mln_result(A) , val_<A>
>
{
typedef mln_value(A) value;
typedef mln_result(A) result;
Index: trunk/milena/mln/accu/mean.hh
===================================================================
--- trunk/milena/mln/accu/mean.hh (revision 1236)
+++ trunk/milena/mln/accu/mean.hh (revision 1237)
@@ -35,6 +35,7 @@
* \todo Use accu::pair just like in accu::min_max.
*/
+# include <mln/accu/internal/base.hh>
# include <mln/accu/count.hh>
# include <mln/accu/sum.hh>
@@ -57,7 +58,7 @@
template <typename V,
typename S = mln_sum(V),
typename M = S>
- struct mean_ : public Accumulator< mean_<V,S,M> >
+ struct mean_ : public mln::accu::internal::base_< M , mean_<V,S,M> >
{
typedef V value;
typedef M result;