1 #ifndef MATH_FunctionNode_H
2 #define MATH_FunctionNode_H
28 SV::MATH_RootExpression mArguments;
51 virtual SP::MATH_FunctionNode
newInstance()
const=0;
74 return mArguments.getSize();
78 inline SPC::MATH_RootExpression
getArgument(
const int& index)
const {
80 if (index>=mArguments.getSize()) {
81 SPC::MATH_RootExpression nullArg;
84 return mArguments[index];
88 inline SP::MATH_RootExpression
getArgument(
const int& index) {
89 if (index>=mArguments.getSize()) {
90 SP::MATH_RootExpression nullArg;
93 return mArguments[index];
DEFINE_SVPTR(MATH_FunctionNode)
void addArgument(SP::MATH_RootExpression arg)
add arguments
Definition: MATH_FunctionNode.h:58
This class decribes a variable class for evaluation.
Definition: MATH_Variable.h:16
tString readArguments(const tString &formula, MATH_Environment &symbols)
read the arguments from formula & add the found symbols in symbols list
Definition: MATH_FunctionNode.cpp:15
This class is the base class of a math expression.
Definition: MATH_Expression.h:24
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_FunctionNode.cpp:62
#define tBoolean
Definition: types.h:35
DEFINE_SPTR(MATH_FunctionNode)
virtual tString toString() const
return the string representation of the class
Definition: MATH_FunctionNode.cpp:74
MATH_FunctionNode(void)
create
Definition: MATH_FunctionNode.cpp:9
virtual ~MATH_FunctionNode(void)
destroy
Definition: MATH_FunctionNode.cpp:12
This class is a leaf of math expression ie either double float long double etc... ...
Definition: MATH_LeafExpression.h:30
virtual SP::MATH_FunctionNode newInstance() const =0
virtual tBoolean isEnvironmentVariableNode() const
return true if the node is a variable to add to environment
Definition: MATH_FunctionNode.h:65
This class is a children of a parent expression.
Definition: MATH_ChildExpression.h:23
virtual int evaluate(const tFlag &action, MATH_Environment &symbols, MATH_Variable &var) const =0
void evaluate the expression
SP::MATH_RootExpression getArgument(const int &index)
get argument at index
Definition: MATH_FunctionNode.h:88
#define tString
Definition: types.h:36
This class decribes an environment class.
Definition: MATH_Environment.h:14
This class decribes a function.
Definition: MATH_FunctionNode.h:21
int getArgumentsNumber() const
get the arguments number
Definition: MATH_FunctionNode.h:73
#define tFlag
Definition: types.h:14
SPC::MATH_RootExpression getArgument(const int &index) const
get argument at index
Definition: MATH_FunctionNode.h:78