00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _plExternalProbFunction_h_
00019 #define _plExternalProbFunction_h_
00020
00021
00022 #include <plObject.h>
00023 #include <plVariablesConjunction.h>
00024 #include <plValues.h>
00025 #include <plDataValues.h>
00026
00027
00028
00029
00030
00031 #include <plExternalProbMethod.h>
00032
00033
00034
00035
00036
00037
00038
00041 class plExternalProbFunction : public plObject
00042 {
00043
00044 protected:
00045
00047 void Output(ostream &out) const;
00048
00050 kplExternalProbFunction *function_at_kernel;
00051
00052 public:
00053
00055 plProbValue operator()(const plValues &values) const;
00056
00058 virtual ~plExternalProbFunction(){};
00059
00063 plExternalProbFunction(const plVariablesConjunction &variables,
00064 plProbValue(*function)(const plValues &input_values));
00065
00066
00070 template <class T>
00071 plExternalProbFunction(const plVariablesConjunction &variables,
00072 T *obj,
00073 plProbValue (T::*method) (const plValues &input_values))
00074 {
00075
00076 string name;
00077
00078
00079
00080 char cbuff[42] = "AnonymousProbMethod";
00081 name = string( cbuff );
00082
00083
00084
00085 function_at_kernel = new kplExternalProbMethod<T>(variables.get_variable_list(),
00086 obj, method, name);
00087
00088 }
00089
00090
00095 plExternalProbFunction(const plVariablesConjunction &variables,
00096 plProbValue (*function)(const plValues &input_values),
00097 const string &func_name);
00098
00099
00103 template <class T>
00104 plExternalProbFunction(const plVariablesConjunction &variables,
00105 T *obj,
00106 plProbValue (T::*method)(const plValues &input_values),
00107 const string &func_name)
00108 {
00109
00110 function_at_kernel =
00111 new kplExternalProbMethod<T>(variables.get_variable_list(),
00112 obj, method, func_name );
00113 }
00114
00115
00116
00117 void write_function_at_kernel(ostream &out) const;
00118
00119 kplExternalProbFunction* get_function_at_kernel()const {return function_at_kernel;};
00120
00121 void destroy();
00122
00123 };
00124
00125
00126 #endif