ThatSnail

Operation.h

May 12th, 2012
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1. #ifndef OPERATION_H
  2. #define OPERATION_H
  3.  
  4. #include "Typedefs.h"
  5.  
  6. class Operation
  7. {
  8. protected:
  9.     virtual statevar Func()=0;
  10.     statevar a,b;
  11.  
  12. private:
  13.     //for load function only
  14.     datacol col; //datacol
  15.     int index; //index
  16.  
  17. public:
  18.     Operation() : a(0), b(0), col(0), index(0){}
  19.  
  20.     statevar getStatevar()
  21.     {
  22.         return Func();
  23.     }
  24. };
  25.  
  26. class OperationAdd : public Operation
  27. {
  28. protected:
  29.     virtual statevar Func()
  30.     {
  31.         return a+b;
  32.     }
  33. };
  34.  
  35. #endif
Advertisement
Add Comment
Please, Sign In to add comment