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
00027 #ifndef MLN_CORE_CONCEPT_FUNCTION_HH
00028 # define MLN_CORE_CONCEPT_FUNCTION_HH
00029
00033
00034 # include <mln/core/concept/object.hh>
00035
00036
00037 namespace mln
00038 {
00039
00040
00041 template <typename E> struct Function;
00042 template <typename E> struct Function_n2v;
00043 template <typename E> struct Function_v2v;
00044 template <typename E> struct Function_v2b;
00045 template <typename E> struct Function_vv2v;
00046 template <typename E> struct Function_vv2b;
00047
00048
00050 template <>
00051 struct Function<void>
00052 {
00053 typedef Object<void> super;
00054 };
00055
00056
00062
00063 template <typename E>
00064 struct Function : public Object<E>
00065 {
00066 typedef Function<void> category;
00067
00070
00071 protected:
00072 Function();
00073 Function(const Function&);
00074
00075
00076
00077
00078
00079 Function<E>& operator=(const Function<E>&);
00080 };
00081
00082
00083
00084
00085
00086
00087 template <>
00088 struct Function_n2v<void> { typedef Function<void> super; };
00089
00090
00097
00098 template <typename E>
00099 struct Function_n2v : public Function<E>
00100 {
00101 typedef Function_n2v<void> category;
00102 protected:
00103 Function_n2v();
00104 Function_n2v(const Function_n2v&);
00105 };
00106
00107
00108
00109
00110
00111
00112 template <>
00113 struct Function_v2v<void> { typedef Function<void> super; };
00114
00115
00122
00123 template <typename E>
00124 struct Function_v2v : public Function<E>
00125 {
00126 typedef Function_v2v<void> category;
00127 typedef void mutable_result;
00128 protected:
00129 Function_v2v();
00130 Function_v2v(const Function_v2v&);
00131 };
00132
00133
00134
00135
00136
00137
00138 template <>
00139 struct Function_v2b<void> { typedef Function_v2v<void> super; };
00140
00141
00148
00149 template <typename E>
00150 struct Function_v2b : public virtual Function_v2v<E>
00151 {
00152 typedef Function_v2b<void> category;
00153 typedef bool result;
00154 protected:
00155 Function_v2b();
00156 Function_v2b(const Function_v2b&);
00157 };
00158
00159
00160
00161
00162
00163
00164
00165 template <>
00166 struct Function_vv2v<void> { typedef Function<void> super; };
00167
00168
00175
00176 template <typename E>
00177 struct Function_vv2v : public Function<E>
00178 {
00179 typedef Function_vv2v<void> category;
00180 protected:
00181 Function_vv2v();
00182 Function_vv2v(const Function_vv2v&);
00183 };
00184
00185
00186
00187
00188
00189
00190 template <>
00191 struct Function_vv2b<void> { typedef Function<void> super; };
00192
00193
00200
00201 template <typename E>
00202 struct Function_vv2b : public Function<E>
00203 {
00204 typedef bool result;
00205 typedef Function_vv2b<void> category;
00206 protected:
00207 Function_vv2b();
00208 Function_vv2b(const Function_vv2b&);
00209 };
00210
00211
00212
00213 # ifndef MLN_INCLUDE_ONLY
00214
00215
00216
00217 template <typename E>
00218 inline
00219 Function<E>::Function()
00220 {
00221 typedef mln_result(E) result;
00222 }
00223
00224 template <typename E>
00225 inline
00226 Function<E>::Function(const Function<E>& rhs)
00227 : Object<E>(rhs)
00228 {
00229 }
00230
00231 template <typename E>
00232 inline
00233 Function<E>&
00234 Function<E>::operator=(const Function<E>&)
00235 {
00236 return *this;
00237 }
00238
00239
00240
00241 template <typename E>
00242 inline
00243 Function_n2v<E>::Function_n2v()
00244 {
00245 }
00246
00247 template <typename E>
00248 inline
00249 Function_n2v<E>::Function_n2v(const Function_n2v<E>& rhs)
00250 : Function<E>(rhs)
00251 {
00252 }
00253
00254
00255
00256
00257 template <typename E>
00258 inline
00259 Function_v2v<E>::Function_v2v()
00260 {
00261 }
00262
00263 template <typename E>
00264 inline
00265 Function_v2v<E>::Function_v2v(const Function_v2v<E>& rhs)
00266 : Function<E>(rhs)
00267 {
00268 }
00269
00270
00271
00272 template <typename E>
00273 inline
00274 Function_v2b<E>::Function_v2b()
00275 {
00276 }
00277
00278 template <typename E>
00279 inline
00280 Function_v2b<E>::Function_v2b(const Function_v2b<E>& rhs)
00281 : Function_v2v<E>(rhs)
00282 {
00283 }
00284
00285
00286
00287 template <typename E>
00288 inline
00289 Function_vv2v<E>::Function_vv2v()
00290 {
00291 }
00292
00293 template <typename E>
00294 inline
00295 Function_vv2v<E>::Function_vv2v(const Function_vv2v<E>& rhs)
00296 : Function<E>(rhs)
00297 {
00298 }
00299
00300
00301
00302 template <typename E>
00303 inline
00304 Function_vv2b<E>::Function_vv2b()
00305 {
00306 }
00307
00308 template <typename E>
00309 inline
00310 Function_vv2b<E>::Function_vv2b(const Function_vv2b<E>& rhs)
00311 : Function<E>(rhs)
00312 {
00313 }
00314
00315 # endif // ! MLN_INCLUDE_ONLY
00316
00317 }
00318
00319
00320 #endif // ! MLN_CORE_CONCEPT_FUNCTION_HH