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-2020 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  scalarRangesI.H
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef scalarRanges_H
42 #define scalarRanges_H
43 
44 #include "scalarRange.H"
45 #include "List.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class scalarRanges Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 class scalarRanges
57 :
58  public List<scalarRange>
59 {
60 public:
61 
62  // Constructors
63 
64  //- Inherit constructors from List of scalarRange
66 
67  //- Default construct
68  constexpr scalarRanges() noexcept = default;
69 
70  //- Construct by parsing string using the parse() static method
71  inline explicit scalarRanges
72  (
73  const std::string& str,
74  bool report = true
75  );
76 
77 
78  // Static Constructors
79 
80  //- Construct by parsing string for scalar ranges
81  // The individual items are space, comma or semicolon delimited.
82  static scalarRanges parse
83  (
84  const std::string& str,
85  bool report = true
86  );
87 
88 
89  // Member Functions
90 
91  //- Match any condition in the list.
92  // \return True if the value matches any condition in the list.
93  inline bool match(const scalar& value) const;
94 
95 
96  // Member Operators
97 
98  //- Use match() as a predicate.
99  inline bool operator()(const scalar& value) const;
100 };
101 
102 
103 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
104 
105 } // End namespace Foam
106 
107 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
108 
109 #include "scalarRangesI.H"
110 
111 #endif
112 
113 // ************************************************************************* //
List.H
Foam::scalarRanges
A collection of scalar bounds to be used as a unary predicate.
Definition: scalarRanges.H:55
Foam::scalarRanges::parse
static scalarRanges parse(const std::string &str, bool report=true)
Construct by parsing string for scalar ranges.
Definition: scalarRanges.C:34
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::scalarRanges::scalarRanges
constexpr scalarRanges() noexcept=default
Default construct.
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:63
Foam::scalarRanges::match
bool match(const scalar &value) const
Match any condition in the list.
Definition: scalarRangesI.H:38
scalarRange.H
Foam::scalarRanges::operator()
bool operator()(const scalar &value) const
Use match() as a predicate.
Definition: scalarRangesI.H:54
scalarRangesI.H