Salome HOME
e2917a3fcd1c4c313ff0009be5006cd18d6a3063
[modules/med.git] / src / MEDCalculator / MEDCalculatorDBRangeSelection.hxx
1 // Copyright (C) 2007-2023  CEA/DEN, EDF R&D
2 //
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, or (at your option) any later version.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 // Author : Anthony Geay (CEA/DEN)
20
21 #ifndef __MEDCALCULATORDBRANGESELECTION_HXX__
22 #define __MEDCALCULATORDBRANGESELECTION_HXX__
23
24 #include "MedCalculatorDefines.hxx"
25 #include "InterpKernelException.hxx"
26
27 #include <vector>
28
29 namespace MEDCoupling
30 {
31   class MEDCALCULATOR_EXPORT MEDCalculatorDBRangeSelection
32   {
33   public:
34     MEDCalculatorDBRangeSelection(const char *v);
35     MEDCalculatorDBRangeSelection(int v);
36     MEDCalculatorDBRangeSelection();
37     void setPyStart(int val);
38     void setPyEnd(int val);
39     MEDCalculatorDBRangeSelection& operator=(const char *v);
40     MEDCalculatorDBRangeSelection& operator=(int v);
41     std::vector<std::size_t> getIds(int lgth) const;
42     int getSize(int lgth) const;
43     bool isAll() const;
44     void setAll();
45   private:
46     void setValue(const char *v);
47     void setValue(int v);
48     static int TraducePyVal(int val);
49   private:
50     static const char SEPARATOR=':';
51     static const char ALL_ELTS[];
52   private:
53     int _start;
54     int _end;
55   };
56 }
57
58 #endif