00001 #ifndef gridripper_math_expr_StkFunc_h
00002 #define gridripper_math_expr_StkFunc_h
00003
00004 #include <gridripper/math/expr/StkOp.h>
00005
00006 namespace gridripper { namespace math { namespace expr {
00007
00008 using namespace std;
00009
00018 class StkFunc: public StkOp
00019 {
00020 protected:
00022 string stkfName;
00023
00025 int stkfArgc;
00026
00027 public:
00033 StkFunc(const StkFunc& other);
00034
00035 virtual ~StkFunc();
00036
00037 protected:
00041 StkFunc(const string& name, int argc);
00042
00043 public:
00045 const string& getOpName() const { return stkfName; }
00046
00048 int getArgCount() const { return stkfArgc; }
00049
00051 int getStackIncrement() const { return 1 - stkfArgc; }
00052
00057 virtual bool equalsOp(const StkOp& other) const {
00058 if(this == &other) {
00059 return true;
00060 }
00061 if(stkfName != "") {
00062 return stkfName == other.getOpName()
00063 && getArgCount() == other.getArgCount();
00064 }
00065 return false;
00066 }
00067
00073 virtual bool dependsOn(const StkOp& f) const {
00074 return false;
00075 }
00076
00081 virtual void evalStack(GReal_t* &p) const =0;
00082
00087 virtual string getClassName() const { return "StkFunc"; }
00088 };
00089
00090 } } }
00091
00092 #endif