scalarRanges.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2018 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::scalarRanges
28 
29 Description
30  A collection of scalar bounds to be used as a unary predicate.
31 
32 SeeAlso
33  Foam::predicates::scalars
34 
35 SourceFiles
36  scalarRanges.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef scalarRanges_H
41 #define scalarRanges_H
42 
43 #include "scalarRange.H"
44 #include "List.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class scalarRanges Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 class scalarRanges
56 :
57  public List<scalarRange>
58 {
59 public:
60 
61  // Constructors
62 
63  //- Inherit constructors from List of scalarRange
65 
66  //- Construct null
67  inline scalarRanges();
68 
69  //- Construct by parsing string for scalar ranges
70  // The individual items are space, comma or semicolon delimited.
71  // Optionally report when any range failed to parse
72  inline explicit scalarRanges
73  (
74  const std::string& str,
75  bool verbose = true
76  );
77 
78 
79  // Static Constructors
80 
81  //- Construct by parsing string for scalar ranges
82  // The individual items are space, comma or semicolon delimited.
83  static scalarRanges parse(const std::string& str, bool verbose = true);
84 
85 
86  // Member Functions
87 
88  //- Match any condition in the list.
89  // \return True if the value matches any condition in the list.
90  inline bool match(const scalar& value) const;
91 
92 
93  // Member Operators
94 
95  //- Identical to match(), for use as a predicate.
96  inline bool operator()(const scalar& value) const;
97 
98 };
99 
100 
101 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
102 
103 } // End namespace Foam
104 
105 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
106 
107 #include "scalarRangesI.H"
108 
109 #endif
110 
111 // ************************************************************************* //
List.H
Foam::scalarRanges
A collection of scalar bounds to be used as a unary predicate.
Definition: scalarRanges.H:54
Foam::scalarRanges::parse
static scalarRanges parse(const std::string &str, bool verbose=true)
Construct by parsing string for scalar ranges.
Definition: scalarRanges.C:34
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:102
Foam::scalarRanges::match
bool match(const scalar &value) const
Match any condition in the list.
Definition: scalarRangesI.H:44
scalarRange.H
Foam::scalarRanges::operator()
bool operator()(const scalar &value) const
Identical to match(), for use as a predicate.
Definition: scalarRangesI.H:60
Foam::scalarRanges::scalarRanges
scalarRanges()
Construct null.
Definition: scalarRangesI.H:30
scalarRangesI.H