AnimatLab  2
Test
StdPostFixEval.h
Go to the documentation of this file.
1 
7 #pragma once
8 
9 namespace StdUtils
10 {
19 class STD_UTILS_PORT CStdPostFixEval
20 {
21 protected:
23  std::string m_strEquation;
24 
26  CStdArray<std::string> m_aryPostFix;
27 
29  CStdPtrArray<CStdVariable> m_aryVariables;
30 
32  CStdStack<double> m_aryStack;
33 
35  double m_dblSolution;
36 
37  void SavePostFixInArray(std::string &strEqu);
38  void GetParams(double &dblLeft, double &dblRight, int iNumParams);
39  CStdVariable *FindVariable(std::string strVarName);
40  void FillInVariables(CStdArray<std::string> &aryPostFix);
41 
42 public:
44  virtual ~CStdPostFixEval();
45 
46  void AddVariable(std::string strVarName);
47  void SetVariable(std::string strVarName, double dblVal);
48 
49  double Solution();
50 
51  void Equation(std::string strVal);
52  std::string Equation();
53 
54  double Solve();
55 };
56 
57 } //StdUtils
A variable that is used within the CStdPostFixEval class.
Definition: StdVariable.h:17
CStdStack< double > m_aryStack
Stack of equation parts.
std::string m_strEquation
The post-fix equation.
double m_dblSolution
The double solution value.
CStdArray< std::string > m_aryPostFix
internal array used to store the equation parts.
Namespace for the standard utility objects.
Definition: MarkupSTL.cpp:19
Standard post fix evaluation class.
CStdPtrArray< CStdVariable > m_aryVariables
Array of variables.