00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef MLN_TRAIT_ACCUMULATOR_PRINT_HH
00027 # define MLN_TRAIT_ACCUMULATOR_PRINT_HH
00028
00032
00033 # include <iostream>
00034 # include <mln/trait/accumulators.hh>
00035 # include <mln/metal/is_a.hh>
00036
00037
00038
00039 namespace mln
00040 {
00041
00042
00043 template <typename E> struct Accumulator;
00044
00045
00046 namespace trait
00047 {
00048
00049 namespace accumulator
00050 {
00051
00052 template <typename A>
00053 void print(std::ostream& ostr = std::cout);
00054
00055 template <typename A>
00056 void print(const Accumulator<A>& ima, std::ostream& ostr = std::cout);
00057
00058
00059 # ifndef MLN_INCLUDE_ONLY
00060
00061 template <typename A>
00062 inline
00063 void print(std::ostream& ostr)
00064 {
00065 mlc_is_a(A, Accumulator)::check();
00066 typedef mln::trait::accumulator_<A> the;
00067 ostr << "{ "
00068 << typename the::has_untake().name() << ", "
00069 << typename the::has_stop().name() << ", "
00070 << typename the::has_set_value().name() << ", "
00071 << typename the::when_pix().name() << " }" << std::endl;
00072 }
00073
00074 template <typename A>
00075 inline
00076 void print(const Accumulator<A>&, std::ostream& ostr)
00077 {
00078 print<A>(ostr);
00079 }
00080
00081 # endif // ! MLN_INCLUDE_ONLY
00082
00083 }
00084
00085 }
00086
00087 }
00088
00089
00090 #endif // ! MLN_TRAIT_ACCUMULATOR_PRINT_HH