]> SALOME platform Git repositories - modules/kernel.git/blob - src/Notebook/SALOME_EvalExpr.hxx
Salome HOME
Implementation of expression evaluator
[modules/kernel.git] / src / Notebook / SALOME_EvalExpr.hxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  File   : SALOME_EvalExpr.hxx
23 //  Author : Peter KURNEV
24 //  Module : SALOME
25
26 #ifndef SALOME_EvalExpr_Header_File
27 #define SALOME_EvalExpr_Header_File
28
29 #include <SALOME_Eval.hxx>
30 #include <SALOME_EvalVariant.hxx>
31 #include <SALOME_EvalParser.hxx>
32 #include <SALOME_EvalSet.hxx>
33
34 class SALOME_EvalExpr
35 {
36 public:
37   SALOME_EvalExpr(const RString& = RString());
38   SALOME_EvalExpr( const bool, const RString& = RString() );
39   ~SALOME_EvalExpr();
40
41   SALOME_EvalVariant           calculate( const RString& = RString() );
42
43   RString            expression() const;
44   void               setExpression( const RString& );
45
46   SALOME_EvalExprError              error() const;
47   SALOME_EvalParser*     parser() const;
48
49   bool               autoDeleteOperationSets() const;
50   void               setAutoDeleteOperationSets( const bool );
51
52   SALOME_ListOfPEvalSet  operationSets() const;
53   SALOME_EvalSet*        operationSet( const RString& ) const;
54   void               removeOperationSet(SALOME_EvalSet* );
55   void               insertOperationSet(SALOME_EvalSet*, 
56                                         const int = -1 );
57
58 private:
59   void               intialize(const bool, 
60                                const RString& );
61
62 private:
63   RString            myExpr;
64   SALOME_EvalParser*     myParser;
65 };
66
67 #endif