1 // Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/
19 // File: QtxStdOperations.h
20 // Author: Alexander SOLOVYOV
22 #ifndef __QTX_STD_OPERATIONS_HEADER__
23 #define __QTX_STD_OPERATIONS_HEADER__
26 #include "QtxOperations.h"
29 \class QtxStdOperations
30 Provides simplified interface for standard operations.
31 Conatins list of operation names, priority and possible types
33 class QTX_EXPORT QtxStdOperations : public QtxOperations
37 virtual ~QtxStdOperations();
39 virtual void opersList( QStringList& ) const;
40 virtual void bracketsList( QStringList&, bool open ) const;
42 virtual QtxParser::Error isValid( const QString&,
44 const QVariant::Type ) const;
46 typedef QValueList< QVariant::Type > ListOfTypes;
48 void addOperations( const QStringList& );
49 void addTypes( const ListOfTypes& );
58 Provides set of arithmetic operations for parser
60 class QTX_EXPORT QtxArithmetics : public QtxStdOperations
64 virtual ~QtxArithmetics();
66 virtual bool createValue( const QString&, QtxValue& ) const;
67 virtual int prior( const QString&, bool isBin ) const;
68 virtual QtxParser::Error calculate( const QString&, QtxValue&, QtxValue& ) const;
73 Provides set of logic operations for parser
75 class QTX_EXPORT QtxLogic : public QtxStdOperations
81 virtual bool createValue( const QString&, QtxValue& ) const;
82 virtual int prior( const QString&, bool isBin ) const;
83 virtual QtxParser::Error calculate( const QString&, QtxValue&, QtxValue& ) const;
88 Provides set of more complex operations for parser (sqrt, sin, cos, etc)
90 class QTX_EXPORT QtxFunctions : public QtxStdOperations
94 virtual ~QtxFunctions();
96 virtual bool createValue( const QString&, QtxValue& ) const;
97 virtual int prior( const QString&, bool isBin ) const;
98 virtual QtxParser::Error calculate( const QString&, QtxValue&, QtxValue& ) const;
103 Provides set of string operations for parser
105 class QTX_EXPORT QtxStrings : public QtxStdOperations
109 virtual ~QtxStrings();
111 virtual bool createValue( const QString&, QtxValue& ) const;
112 virtual int prior( const QString&, bool isBin ) const;
113 virtual QtxParser::Error calculate( const QString&, QtxValue&, QtxValue& ) const;
118 Provides set of operations with sets for parser
120 class QTX_EXPORT QtxSets : public QtxStdOperations
123 typedef QValueList< QtxValue > ValueSet;
129 virtual void bracketsList( QStringList&, bool open ) const;
130 virtual bool createValue( const QString&, QtxValue& ) const;
131 virtual int prior( const QString&, bool isBin ) const;
132 virtual QtxParser::Error isValid( const QString&,
133 const QVariant::Type,
134 const QVariant::Type ) const;
135 virtual QtxParser::Error calculate( const QString&, QtxValue&, QtxValue& ) const;
137 static void add( ValueSet&, const QtxValue& );
138 static void add( ValueSet&, const ValueSet& );
139 static void remove( ValueSet&, const QtxValue& );
140 static void remove( ValueSet&, const ValueSet& );