Changeset 2598 in Sophya for trunk/SophyaLib/SysTools/cexpre.h
- Timestamp:
- Aug 11, 2004, 3:10:25 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/SysTools/cexpre.h
r2512 r2598 14 14 namespace SOPHYA { 15 15 16 //! Exception class used by CExpressionEvaluator 16 /*! 17 \ingroup SysTools 18 \brief Exception class used by CExpressionEvaluator 19 */ 17 20 class CExprException : public PException { 18 21 public: … … 22 25 23 26 //-------------------------------------------------------------------- 24 //! Base class for arithmetic expressions used by CExpressionEvaluator 27 /*! 28 \ingroup SysTools 29 \brief Base class for arithmetic expressions used by CExpressionEvaluator 30 \sa CExpressionEvaluator 31 */ 25 32 class CExprBase { 26 33 public: … … 39 46 }; 40 47 48 /*! 49 \ingroup SysTools 50 \brief For formatted write (print) of expressions in a stream 51 */ 41 52 inline ostream& operator << (ostream& s, CExprBase const & ex) 42 53 { ex.Print(s); return(s); } … … 45 56 class CE_FuncExp; 46 57 //--------------------------------------------------------- 47 //! Class for evaluation of arithmetic expressions with C-like syntax48 58 class CExpressionEvaluator : public CExprBase { 49 59 public: 50 60 CExpressionEvaluator(string const & sex); 51 61 virtual ~CExpressionEvaluator(); 62 //! Evaluate the expression and returns the corresponding value. 52 63 virtual double Evaluate() const; 64 //! Alias for Evaluate() 53 65 inline double Value() const { return Evaluate(); } 66 //! Formatted output on a stream 54 67 virtual void Print(ostream& os) const; 55 68 56 69 protected: 70 //! Does the parsing and builds an CExprBase object. 57 71 CExprBase* ParseString(int extype, string fname, string const & sex, 58 72 size_t off, size_t& stop, string& errmsg);
Note:
See TracChangeset
for help on using the changeset viewer.