C++ main module for gpm Package  1.0
MATH_Expression.h
Go to the documentation of this file.
1 #ifndef MATH_Expression_H
2 #define MATH_Expression_H
3 
4 #include "CORE_Object.h"
5 #include "CORE_ListPointers.h"
6 
8 
9 class MATH_Variable;
10 class MATH_Environment;
11 
24 class MATH_Expression : public virtual CORE_Object {
25  SP_OBJECT(MATH_Expression);
26  // ATTRIBUTES
27 
28 
29 public:
30  //NUMERICAL EVALUATION
31  static const tFlag ALGEBRIC;
32 
33  //SET EVALUATION
34  static const tFlag IS_INSIDE;
35  static const tFlag COMPUTE_BOUNDS;
36 
37 
38 
39 
40  //ERROR CODE
41  static const int SUCCESS;
42  static const int FAIL;
43  static const int TYPE_MISMATCHED;
44  static const int SIZE_MISMATCHED;
45  static const int OUT_OF_BOUNDS;
46  static const int NULL_OPERAND;
47 
48 private:
49 
50 
51 
52 protected:
53  // METHODS
54 
55  // CONSTRUCTORS
56 
59  MATH_Expression(void);
60 
61 
62 
63  // DESTRUCTORS
64 
65 
68  virtual ~MATH_Expression(void);
69 
70 
71 private:
72 
73 public:
74 
75 
76  // SET methods
77 
78 
79 
80 public:
81 
82 
83 
104  virtual int evaluate(const tFlag& action,MATH_Environment& symbols,
105  MATH_Variable& value) const=0;
106 
111  inline int evaluate(MATH_Environment& symbols,MATH_Variable& value) const {
112  return evaluate(ALGEBRIC,symbols,value);
113  }
114 
115 
116 public:
117  // OTHERS methods
118 
119 
120 };
121 
122 #endif
MATH_Expression(void)
create
Definition: MATH_Expression.cpp:15
static const tFlag COMPUTE_BOUNDS
Definition: MATH_Expression.h:35
This class decribes a variable class for evaluation.
Definition: MATH_Variable.h:16
static const int OUT_OF_BOUNDS
Definition: MATH_Expression.h:45
This class is the base class of a math expression.
Definition: MATH_Expression.h:24
static const int SIZE_MISMATCHED
Definition: MATH_Expression.h:44
static const tFlag IS_INSIDE
Definition: MATH_Expression.h:34
This class is a root expression The MATH_RootExpression::newClassFactoryInstance() creates the class ...
Definition: MATH_RootExpression.h:24
virtual ~MATH_Expression(void)
destroy
Definition: MATH_Expression.cpp:18
virtual int evaluate(const tFlag &action, MATH_Environment &symbols, MATH_Variable &value) const =0
void evaluate the expression
static const int FAIL
Definition: MATH_Expression.h:42
abstract base class for most classes.
Definition: CORE_Object.h:30
static const int TYPE_MISMATCHED
Definition: MATH_Expression.h:43
int evaluate(MATH_Environment &symbols, MATH_Variable &value) const
void evaluate the algebric expression
Definition: MATH_Expression.h:111
DEFINE_SPTR(MATH_Expression)
This class decribes an environment class.
Definition: MATH_Environment.h:14
static const int SUCCESS
Definition: MATH_Expression.h:41
static const int NULL_OPERAND
Definition: MATH_Expression.h:46
static const tFlag ALGEBRIC
Definition: MATH_Expression.h:31
#define tFlag
Definition: types.h:14