HermesCommon  3.0
range.h
Go to the documentation of this file.
1 // This file is part of Hermes2D.
2 //
3 // Hermes2D is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation, either version 2 of the License, or
6 // (at your option) any later version.
7 //
8 // Hermes2D 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
11 // GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with Hermes2D. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef __HERMES_COMMON_RANGE_H
19 #define __HERMES_COMMON_RANGE_H
20 
21 #include "util/compat.h"
22 
23 namespace Hermes
24 {
26  class HERMES_API Range
27  {
28  public:
29  Range();
30  Range(const int& lower_bound, const int& upper_bound);
32  bool empty() const;
34  const int& lower() const;
36  const int& upper() const;
37  bool is_in_closed(const Range& range) const;
38  bool is_in_closed(const int& value) const;
39  bool is_in_open(const int& value) const;
40  void enlarge_to_include(const int& value);
41 
42  static Range make_envelope(const Range& a, const Range& b);
43  protected:
44  int lower_bound;
45  int upper_bound;
46  bool empty_range;
47  };
48 }
49 #endif
General namespace for the Hermes library.
Range of values.
Definition: range.h:26
File containing platform compatibility layer, especially for Win / MSVC.