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_CONVERT_IMPL_FROM_VALUE_TO_VALUE_HH
00027 # define MLN_CONVERT_IMPL_FROM_VALUE_TO_VALUE_HH
00028
00034
00035
00036 # include <utility>
00037 # include <mln/core/concept/image.hh>
00038 # include <mln/core/concept/site_set.hh>
00039 # include <mln/value/concept/all.hh>
00040
00041 # include <mln/core/site_set/p_run.hh>
00042 # include <mln/metal/converts_to.hh>
00043
00044 # include <mln/convert/from_to.hxx>
00045
00046 namespace mln
00047 {
00048
00049 namespace convert
00050 {
00051
00052 namespace impl
00053 {
00054
00056 template <typename V, typename W>
00057 void
00058 from_value_to_value(const Value<V>& from, Value<W>& to);
00059
00061 template <typename V>
00062 void
00063 from_value_to_value(const Value<V>& from, Value<V>& to);
00064
00065
00066
00067 # ifndef MLN_INCLUDE_ONLY
00068
00069
00070
00071 template <typename V, typename W>
00072 void
00073 from_value_to_value_(const mln::value::Vectorial<V>& from,
00074 mln::value::Vectorial<W>& to)
00075 {
00076 exact(to) = exact(from).to_equiv();
00077 }
00078
00079
00080
00081 template <typename V, typename W>
00082 void
00083 from_value_to_value_(const mln::value::Scalar<V>& from,
00084 mln::value::Scalar<W>& to)
00085 {
00086 exact(to) = exact(from).to_equiv();
00087 }
00088
00089 template <typename V, typename W>
00090 inline
00091 void
00092 from_value_to_value_(const Value<V>& from, Value<W>& to)
00093 {
00094
00095
00096 convert::over_load::from_to_(exact(from), exact(to));
00097 }
00098
00099
00100
00101
00102 template <typename V, typename W>
00103 inline
00104 void
00105 from_value_to_value(const Value<V>& from, Value<W>& to)
00106 {
00107 from_value_to_value_(exact(from), exact(to));
00108 }
00109
00110 template <typename V>
00111 inline
00112 void
00113 from_value_to_value(const Value<V>& from, Value<V>& to)
00114 {
00115 exact(to) = exact(from);
00116 }
00117
00118 # endif // ! MLN_INCLUDE_ONLY
00119
00120 }
00121
00122 }
00123
00124 }
00125
00126
00127 #endif // ! MLN_CONVERT_IMPL_FROM_VALUE_TO_VALUE_HH