C++ main module for gpm Package  1.0
MATH_BinaryOperator.h
Go to the documentation of this file.
1 #ifndef MATH_BinaryOperator_H
2 #define MATH_BinaryOperator_H
3 
4 #include "MATH_Operator.h"
5 
16  SP_OBJECT(MATH_BinaryOperator);
17 
18  // ATTRIBUTES
19 
20 private:
21  int mPriority;
22 
23  protected:
24  // METHODS
25 
26  // CONSTRUCTORS
27 
30  MATH_BinaryOperator(void);
31 
32 
33 
34  // DESTRUCTORS
35 
36 
39  virtual ~MATH_BinaryOperator(void);
40 
41 
42 private:
43 
44 
45  //SET
46 protected:
49  inline void setPriority(const int &p) {mPriority=p;};
50 
51  // GET
52 public:
55  int getLastFreeChildIndex() const {
56  if (getArgument(0).get()!=null) return 1;
57  return 0;
58  }
61  inline int getPriority() const{return mPriority;};
62 
63  // OTHERS methods
87 
90  virtual tString toString() const;
91 
92 private:
96  virtual void addInBestOperatorOfTree(MATH_ChildExpression* ctree) ;
97 };
98 
99 #endif
int getLastFreeChildIndex() const
Definition: MATH_BinaryOperator.h:55
This class is the base class of a math expression.
Definition: MATH_Expression.h:24
SPC::MATH_ChildExpression getArgument(const int &i) const
get argument at index i for reading
Definition: MATH_ParentExpression.h:124
This class decribes an operator with a name.
Definition: MATH_Operator.h:15
virtual MATH_ChildExpression * insertInTree(MATH_Expression *tree, MATH_Environment &symbols, tString &expr)
insert the node This in tree & erase the This corresponding character in expr
Definition: MATH_BinaryOperator.cpp:54
DEFINE_SVPTR(MATH_BinaryOperator)
#define null
Definition: types.h:13
void setPriority(const int &p)
set the priority of the operator
Definition: MATH_BinaryOperator.h:49
virtual ~MATH_BinaryOperator(void)
destroy
Definition: MATH_BinaryOperator.cpp:12
virtual tString toString() const
return the string representation of the class
Definition: MATH_BinaryOperator.cpp:86
This class decribes a binary operator.
Definition: MATH_BinaryOperator.h:15
This class is a children of a parent expression.
Definition: MATH_ChildExpression.h:23
#define tString
Definition: types.h:36
This class decribes an environment class.
Definition: MATH_Environment.h:14
int getPriority() const
return the priority of the operator
Definition: MATH_BinaryOperator.h:61
MATH_BinaryOperator(void)
create
Definition: MATH_BinaryOperator.cpp:6
DEFINE_SPTR(MATH_BinaryOperator)