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_CORE_CONCEPT_FUNCTION_HH
00027 # define MLN_CORE_CONCEPT_FUNCTION_HH
00028
00032
00033 # include <mln/core/concept/object.hh>
00034
00035
00036 namespace mln
00037 {
00038
00039
00040 template <typename E> struct Function;
00041 template <typename E> struct Function_n2v;
00042 template <typename E> struct Function_v2v;
00043 template <typename E> struct Function_v2b;
00044 template <typename E> struct Function_vv2v;
00045 template <typename E> struct Function_vv2b;
00046
00047
00049 template <>
00050 struct Function<void>
00051 {
00052 typedef Object<void> super;
00053 };
00054
00055
00061
00062 template <typename E>
00063 struct Function : public Object<E>
00064 {
00065 typedef Function<void> category;
00066
00069
00070 protected:
00071 Function();
00072 Function(const Function&);
00073 };
00074
00075
00076
00077
00078
00079
00080 template <>
00081 struct Function_n2v<void> { typedef Function<void> super; };
00082
00083
00090
00091 template <typename E>
00092 struct Function_n2v : public Function<E>
00093 {
00094 typedef Function_n2v<void> category;
00095 protected:
00096 Function_n2v();
00097 Function_n2v(const Function_n2v&);
00098 };
00099
00100
00101
00102
00103
00104
00105 template <>
00106 struct Function_v2v<void> { typedef Function<void> super; };
00107
00108
00115
00116 template <typename E>
00117 struct Function_v2v : public Function<E>
00118 {
00119 typedef Function_v2v<void> category;
00120 typedef void mutable_result;
00121 protected:
00122 Function_v2v();
00123 Function_v2v(const Function_v2v&);
00124 };
00125
00126
00127
00128
00129
00130
00131 template <>
00132 struct Function_v2b<void> { typedef Function_v2v<void> super; };
00133
00134
00141
00142 template <typename E>
00143 struct Function_v2b : public virtual Function_v2v<E>
00144 {
00145 typedef Function_v2b<void> category;
00146 typedef bool result;
00147 protected:
00148 Function_v2b();
00149 Function_v2b(const Function_v2b&);
00150 };
00151
00152
00153
00154
00155
00156
00157
00158 template <>
00159 struct Function_vv2v<void> { typedef Function<void> super; };
00160
00161
00168
00169 template <typename E>
00170 struct Function_vv2v : public Function<E>
00171 {
00172 typedef Function_vv2v<void> category;
00173 protected:
00174 Function_vv2v();
00175 Function_vv2v(const Function_vv2v&);
00176 };
00177
00178
00179
00180
00181
00182
00183 template <>
00184 struct Function_vv2b<void> { typedef Function<void> super; };
00185
00186
00193
00194 template <typename E>
00195 struct Function_vv2b : public Function<E>
00196 {
00197 typedef bool result;
00198 typedef Function_vv2b<void> category;
00199 protected:
00200 Function_vv2b();
00201 Function_vv2b(const Function_vv2b&);
00202 };
00203
00204
00205
00206 # ifndef MLN_INCLUDE_ONLY
00207
00208
00209
00210 template <typename E>
00211 inline
00212 Function<E>::Function()
00213 {
00214 typedef mln_result(E) result;
00215 }
00216
00217 template <typename E>
00218 inline
00219 Function<E>::Function(const Function<E>& rhs)
00220 : Object<E>(rhs)
00221 {
00222 }
00223
00224
00225
00226
00227 template <typename E>
00228 inline
00229 Function_n2v<E>::Function_n2v()
00230 {
00231 }
00232
00233 template <typename E>
00234 inline
00235 Function_n2v<E>::Function_n2v(const Function_n2v<E>& rhs)
00236 : Function<E>(rhs)
00237 {
00238 }
00239
00240
00241
00242
00243 template <typename E>
00244 inline
00245 Function_v2v<E>::Function_v2v()
00246 {
00247 }
00248
00249 template <typename E>
00250 inline
00251 Function_v2v<E>::Function_v2v(const Function_v2v<E>& rhs)
00252 : Function<E>(rhs)
00253 {
00254 }
00255
00256
00257
00258 template <typename E>
00259 inline
00260 Function_v2b<E>::Function_v2b()
00261 {
00262 }
00263
00264 template <typename E>
00265 inline
00266 Function_v2b<E>::Function_v2b(const Function_v2b<E>& rhs)
00267 : Function_v2v<E>(rhs)
00268 {
00269 }
00270
00271
00272
00273 template <typename E>
00274 inline
00275 Function_vv2v<E>::Function_vv2v()
00276 {
00277 }
00278
00279 template <typename E>
00280 inline
00281 Function_vv2v<E>::Function_vv2v(const Function_vv2v<E>& rhs)
00282 : Function<E>(rhs)
00283 {
00284 }
00285
00286
00287
00288 template <typename E>
00289 inline
00290 Function_vv2b<E>::Function_vv2b()
00291 {
00292 }
00293
00294 template <typename E>
00295 inline
00296 Function_vv2b<E>::Function_vv2b(const Function_vv2b<E>& rhs)
00297 : Function<E>(rhs)
00298 {
00299 }
00300
00301 # endif // ! MLN_INCLUDE_ONLY
00302
00303 }
00304
00305
00306 #endif // ! MLN_CORE_CONCEPT_FUNCTION_HH