C++ main module for gpm Package  1.0
MATH_NodeExpression.h
Go to the documentation of this file.
1 #ifndef MATH_NodeExpression_H
2 #define MATH_NodeExpression_H
3 
5 #include "MATH_ChildExpression.h"
6 
18 class MATH_NodeExpression : public virtual MATH_ParentExpression, public virtual MATH_ChildExpression {
19  SP_OBJECT(MATH_NodeExpression);
20 
21  // ATTRIBUTES
22 
23 
24 protected:
25  // METHODS
26 
27  // CONSTRUCTORS
28 
31  MATH_NodeExpression(void);
32 
33 
34 
35  // DESTRUCTORS
36 
37 
40  virtual ~MATH_NodeExpression(void);
41 
42 
43 private:
44 
45 public:
48  virtual SP::MATH_NodeExpression newInstance() const=0;
49 
50  // SET methods
51 
56  virtual tBoolean addArgument(SP::MATH_ChildExpression operand);
57 
63  return MATH_ParentExpression::addArgument(operand);
64  }
65 
66  // GET methods
67 
70  virtual const MATH_RootExpression* getRootNode() const {
72  }
73 public:
74  // OTHERS methods
75 
96  virtual int evaluate(const tFlag& action,MATH_Environment& symbols,MATH_Variable& var) const{
97  return MATH_ParentExpression::evaluate(action,symbols,var);
98  }
99 
100 
101 
102 };
103 
104 #endif
This class decribes a variable class for evaluation.
Definition: MATH_Variable.h:16
virtual SP::MATH_NodeExpression newInstance() const =0
create a new instance of expression
This class is a node of expression tree with is a parent and a child.
Definition: MATH_NodeExpression.h:18
virtual int evaluate(const tFlag &action, MATH_Environment &symbols, MATH_Variable &var) const
void evaluate the expression
Definition: MATH_ParentExpression.h:163
virtual tBoolean addArgument(SP::MATH_ChildExpression operand)
add the argument in the node. If the max number of arguments is reach, try to copu the node in order ...
Definition: MATH_NodeExpression.cpp:10
virtual const MATH_RootExpression * getRootNode() const
return the root node of the node
Definition: MATH_NodeExpression.h:70
#define tBoolean
Definition: types.h:35
virtual int evaluate(const tFlag &action, MATH_Environment &symbols, MATH_Variable &var) const
void evaluate the expression
Definition: MATH_NodeExpression.h:96
virtual tBoolean addArgument(MATH_ChildExpression *operand)
add the argument If the max number of arguments is reach, try to copu the node in order to add the ar...
Definition: MATH_NodeExpression.h:62
This class is a root expression The MATH_RootExpression::newClassFactoryInstance() creates the class ...
Definition: MATH_RootExpression.h:24
DEFINE_SPTR(MATH_NodeExpression)
This class is a children of a parent expression.
Definition: MATH_ChildExpression.h:23
virtual tBoolean addArgument(SP::MATH_ChildExpression operand)
add the argument
Definition: MATH_ParentExpression.cpp:11
This class describes a parent of math expression tree. A parent have arguments:
Definition: MATH_ParentExpression.h:22
This class decribes an environment class.
Definition: MATH_Environment.h:14
virtual const MATH_RootExpression * getRootNode() const
return the root node of the node
Definition: MATH_ChildExpression.cpp:14
MATH_NodeExpression(void)
create
Definition: MATH_NodeExpression.cpp:4
virtual ~MATH_NodeExpression(void)
destroy
Definition: MATH_NodeExpression.cpp:7
#define tFlag
Definition: types.h:14