00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _plExternalProbMethod_h_
00020 #define _plExternalProbMethod_h_
00021
00022 #include <plVariablesConjunction.h>
00023 #include <plValues.h>
00024 #include <plExternProbFuncAtKernel.h>
00025
00026
00027
00028
00029 template<class T>
00030 class kplExternalProbMethod : public kplExternalProbFunction
00031 {
00032 private:
00033
00034
00035 T *user_object;
00036
00038 plProbValue (T::*user_method)(const plValues &input);
00039
00040
00041 public:
00042 kplExternalProbMethod(){};
00043 kplExternalProbMethod(const list <kplVariable*>& vars,
00044 T *obj,
00045 plProbValue (T::*method)(const plValues &input),
00046 const string& func_name)
00047 :kplExternalProbFunction(vars, func_name),
00048 user_object(obj), user_method(method)
00049 {}
00050
00051
00052
00053 virtual ~kplExternalProbMethod(){};
00054
00055 #ifdef PL_PARA_WITH_NEWF
00056 plProbValue operator()(const plDataValues& values) const
00057 {
00058 plValues input_values_copy(*input_values, (plDataValues*)&values);
00059 return (user_object->*user_method)(input_values_copy);
00060 }
00061 #else
00062 plProbValue operator()(const plValues& values) const
00063 {
00064 return (user_object->*user_method)(values);
00065 }
00066 #endif
00067
00068 };
00069
00070
00071
00072 #endif